home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / progrmng / harvestc.sit / Harvest C Folder / Examples / Sample2a.c < prev    next >
MacBinary  |  1991-10-12  |  41.1 KB  |  [TEXT/ALFA]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Sat Oct 12 17:18:05 1991, modified Sat Oct 12 17:18:05 1991, creator Alpha editor, type ASCII, 41421 bytes "Sample2a.c" , at 0xa24d 428 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[ALFA]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0a 53 61 6d 70 6c 65 | 32 61 2e 63 00 00 00 00 |..Sample|2a.c....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 41 4c 46 | 41 01 00 00 00 00 00 00 |.TEXTALF|A.......|
|00000050| 00 00 00 00 00 a1 cd 00 | 00 01 ac a5 1d 17 0d a5 |........|........|
|00000060| 1d 17 0d 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 de a8 00 00 |........|........|
|00000080| 2f 2a 0d 09 54 72 61 6e | 73 53 6b 65 6c 20 2d 20 |/*..Tran|sSkel - |
|00000090| 54 72 61 6e 73 70 6f 72 | 74 61 62 6c 65 20 61 70 |Transpor|table ap|
|000000a0| 70 6c 69 63 61 74 69 6f | 6e 20 73 6b 65 6c 65 74 |plicatio|n skelet|
|000000b0| 6f 6e 0d 09 54 72 61 6e | 73 53 6b 65 6c 20 69 73 |on..Tran|sSkel is|
|000000c0| 20 70 75 62 6c 69 63 20 | 64 6f 6d 61 69 6e 2e 0d | public |domain..|
|000000d0| 09 56 65 72 73 69 6f 6e | 20 32 2e 36 20 6f 66 20 |.Version| 2.6 of |
|000000e0| 38 2f 31 37 2f 39 30 0d | 0d 09 54 68 69 73 20 76 |8/17/90.|..This v|
|000000f0| 65 72 73 69 6f 6e 20 62 | 79 3a 0d 09 09 09 42 6f |ersion b|y:....Bo|
|00000100| 62 20 53 63 68 75 6d 61 | 6b 65 72 20 61 6e 64 20 |b Schuma|ker and |
|00000110| 44 61 6e 20 48 69 74 65 | 0d 09 09 09 54 68 65 20 |Dan Hite|....The |
|00000120| 41 4d 49 58 20 43 6f 72 | 70 6f 72 61 74 69 6f 6e |AMIX Cor|poration|
|00000130| 0d 09 09 09 32 33 34 35 | 20 59 61 6c 65 20 53 74 |....2345| Yale St|
|00000140| 72 65 65 74 0d 09 09 09 | 50 61 6c 6f 20 41 6c 74 |reet....|Palo Alt|
|00000150| 6f 2c 20 43 41 20 39 34 | 33 30 36 0d 0d 09 55 55 |o, CA 94|306...UU|
|00000160| 43 50 3a 09 7b 73 75 6e | 2c 20 75 75 6e 65 74 7d |CP:.{sun|, uunet}|
|00000170| 21 6d 61 72 6b 65 74 73 | 21 5b 62 6f 62 2c 64 61 |!markets|![bob,da|
|00000180| 6e 5d 0d 09 41 52 50 41 | 3a 09 5b 62 6f 62 2c 64 |n]..ARPA|:.[bob,d|
|00000190| 61 6e 5d 40 61 6d 69 78 | 2e 63 6f 6d 0d 0d 09 20 |an]@amix|.com... |
|000001a0| 4f 72 69 67 69 6e 61 6c | 6c 79 20 77 72 69 74 74 |Original|ly writt|
|000001b0| 65 6e 20 62 79 3a 0d 09 | 09 09 50 61 75 6c 20 44 |en by:..|..Paul D|
|000001c0| 75 42 6f 69 73 0d 09 09 | 09 57 69 73 63 6f 6e 73 |uBois...|.Wiscons|
|000001d0| 69 6e 20 52 65 67 69 6f | 6e 61 6c 20 50 72 69 6d |in Regio|nal Prim|
|000001e0| 61 74 65 20 52 65 73 65 | 61 72 63 68 20 43 65 6e |ate Rese|arch Cen|
|000001f0| 74 65 72 0d 09 09 09 31 | 32 32 30 20 43 61 70 69 |ter....1|220 Capi|
|00000200| 74 61 6c 20 43 6f 75 72 | 74 0d 09 09 09 4d 61 64 |tal Cour|t....Mad|
|00000210| 69 73 6f 6e 20 57 49 20 | 20 35 33 37 30 36 20 20 |ison WI | 53706 |
|00000220| 55 53 41 0d 0d 09 55 55 | 43 50 3a 09 7b 61 6c 6c |USA...UU|CP:.{all|
|00000230| 65 67 72 61 2c 69 68 6e | 70 34 2c 73 65 69 73 6d |egra,ihn|p4,seism|
|00000240| 6f 7d 21 75 77 76 61 78 | 21 75 77 6d 61 63 63 21 |o}!uwvax|!uwmacc!|
|00000250| 64 75 62 6f 69 73 0d 09 | 41 52 50 41 3a 09 64 75 |dubois..|ARPA:.du|
|00000260| 62 6f 69 73 40 75 6e 69 | 78 2e 6d 61 63 63 2e 77 |bois@uni|x.macc.w|
|00000270| 69 73 63 2e 65 64 75 0d | 09 09 09 64 75 62 6f 69 |isc.edu.|...duboi|
|00000280| 73 40 72 68 65 73 75 73 | 2e 70 72 69 6d 61 74 65 |s@rhesus|.primate|
|00000290| 2e 77 69 73 63 2e 65 64 | 75 0d 2a 2f 0d 0d 2f 2a |.wisc.ed|u.*/../*|
|000002a0| 0d 09 54 68 65 20 66 6f | 6c 6c 6f 77 69 6e 67 20 |..The fo|llowing |
|000002b0| 73 79 6d 62 6f 6c 20 63 | 6f 6e 74 72 6f 6c 73 20 |symbol c|ontrols |
|000002c0| 73 75 70 70 6f 72 74 20 | 66 6f 72 20 64 69 61 6c |support |for dial|
|000002d0| 6f 67 73 2e 0d 09 43 68 | 61 6e 67 69 6e 67 20 23 |ogs...Ch|anging #|
|000002e0| 64 65 66 69 6e 65 20 74 | 6f 20 23 75 6e 64 65 66 |define t|o #undef|
|000002f0| 20 64 69 73 61 62 6c 65 | 73 20 74 68 65 20 73 75 | disable|s the su|
|00000300| 70 70 6f 72 74 2e 0d 2a | 2f 0d 0d 23 69 6e 63 6c |pport..*|/..#incl|
|00000310| 75 64 65 20 22 53 61 6d | 70 6c 65 32 61 2e 68 22 |ude "Sam|ple2a.h"|
|00000320| 0d 0d 23 70 72 61 67 6d | 61 20 73 65 67 6d 65 6e |..#pragm|a segmen|
|00000330| 74 20 53 65 67 33 33 0d | 0d 23 69 66 64 65 66 20 |t Seg33.|.#ifdef |
|00000340| 61 70 70 6c 65 63 0d 23 | 69 6e 63 6c 75 64 65 20 |applec.#|include |
|00000350| 3c 44 65 73 6b 2e 68 3e | 0d 23 69 6e 63 6c 75 64 |<Desk.h>|.#includ|
|00000360| 65 20 3c 44 69 73 6b 49 | 6e 69 74 2e 68 3e 0d 23 |e <DiskI|nit.h>.#|
|00000370| 69 6e 63 6c 75 64 65 20 | 3c 43 75 72 73 6f 72 43 |include |<CursorC|
|00000380| 74 6c 2e 68 3e 0d 23 69 | 6e 63 6c 75 64 65 20 3c |tl.h>.#i|nclude <|
|00000390| 46 6f 6e 74 73 2e 68 3e | 0d 23 69 6e 63 6c 75 64 |Fonts.h>|.#includ|
|000003a0| 65 20 3c 4d 65 6d 6f 72 | 79 2e 68 3e 0d 23 69 6e |e <Memor|y.h>.#in|
|000003b0| 63 6c 75 64 65 20 3c 4f | 53 45 76 65 6e 74 73 2e |clude <O|SEvents.|
|000003c0| 68 3e 0d 23 69 6e 63 6c | 75 64 65 20 3c 52 65 73 |h>.#incl|ude <Res|
|000003d0| 6f 75 72 63 65 73 2e 68 | 3e 0d 23 69 6e 63 6c 75 |ources.h|>.#inclu|
|000003e0| 64 65 20 3c 53 63 72 69 | 70 74 2e 68 3e 0d 23 69 |de <Scri|pt.h>.#i|
|000003f0| 6e 63 6c 75 64 65 20 3c | 54 6f 6f 6c 55 74 69 6c |nclude <|ToolUtil|
|00000400| 73 2e 68 3e 0d 23 65 6c | 73 65 0d 23 64 65 66 69 |s.h>.#el|se.#defi|
|00000410| 6e 65 20 63 75 72 53 79 | 73 45 6e 76 56 65 72 73 |ne curSy|sEnvVers|
|00000420| 09 31 0d 23 69 6e 63 6c | 75 64 65 20 3c 43 6f 6c |.1.#incl|ude <Col|
|00000430| 6f 72 2e 68 3e 0d 23 64 | 65 66 69 6e 65 20 7a 6f |or.h>.#d|efine zo|
|00000440| 6f 6d 44 6f 63 50 72 6f | 63 20 38 0d 23 64 65 66 |omDocPro|c 8.#def|
|00000450| 69 6e 65 09 44 72 61 67 | 47 72 61 79 52 67 6e 50 |ine.Drag|GrayRgnP|
|00000460| 72 6f 63 50 74 72 09 50 | 72 6f 63 50 74 72 0d 23 |rocPtr.P|rocPtr.#|
|00000470| 65 6e 64 69 66 0d 0d 2f | 2a 0d 09 4e 65 77 28 54 |endif../|*..New(T|
|00000480| 79 70 65 4e 61 6d 65 29 | 20 72 65 74 75 72 6e 73 |ypeName)| returns|
|00000490| 20 68 61 6e 64 6c 65 20 | 74 6f 20 6e 65 77 20 6f | handle |to new o|
|000004a0| 62 6a 65 63 74 2c 20 66 | 6f 72 20 61 6e 79 20 54 |bject, f|or any T|
|000004b0| 79 70 65 4e 61 6d 65 2e | 0d 09 49 66 20 74 68 65 |ypeName.|..If the|
|000004c0| 72 65 20 69 73 20 69 6e | 73 75 66 66 69 63 69 65 |re is in|sufficie|
|000004d0| 6e 74 20 6d 65 6d 6f 72 | 79 2c 20 74 68 65 20 72 |nt memor|y, the r|
|000004e0| 65 73 75 6c 74 20 69 73 | 20 6e 69 6c 2e 0d 2a 2f |esult is| nil..*/|
|000004f0| 0d 0d 23 64 65 66 69 6e | 65 09 4e 65 77 28 78 29 |..#defin|e.New(x)|
|00000500| 09 28 78 20 2a 2a 29 20 | 4e 65 77 48 61 6e 64 6c |.(x **) |NewHandl|
|00000510| 65 20 28 73 69 7a 65 6f | 66 20 28 78 29 29 0d 0d |e (sizeo|f (x))..|
|00000520| 0d 2f 2a 0d 09 57 69 6e | 64 6f 77 20 61 6e 64 20 |./*..Win|dow and |
|00000530| 4d 65 6e 75 20 68 61 6e | 64 6c 65 72 20 74 79 70 |Menu han|dler typ|
|00000540| 65 73 2c 20 63 6f 6e 73 | 74 61 6e 74 73 2c 20 76 |es, cons|tants, v|
|00000550| 61 72 69 61 62 6c 65 73 | 2e 0d 0d 09 77 68 4c 69 |ariables|....whLi|
|00000560| 73 74 20 61 6e 64 20 6d | 68 4c 69 73 74 20 61 72 |st and m|hList ar|
|00000570| 65 20 74 68 65 20 6c 69 | 73 74 73 20 6f 66 20 77 |e the li|sts of w|
|00000580| 69 6e 64 6f 77 20 61 6e | 64 20 6d 65 6e 75 20 68 |indow an|d menu h|
|00000590| 61 6e 64 6c 65 72 73 2e | 0d 09 77 68 43 6c 6f 62 |andlers.|..whClob|
|000005a0| 4f 6e 52 6d 76 65 20 61 | 6e 64 20 6d 68 43 6c 6f |OnRmve a|nd mhClo|
|000005b0| 62 4f 6e 52 6d 76 65 20 | 61 72 65 20 74 72 75 65 |bOnRmve |are true|
|000005c0| 20 69 66 20 74 68 65 20 | 68 61 6e 64 6c 65 72 20 | if the |handler |
|000005d0| 64 69 73 70 6f 73 61 6c | 20 70 72 6f 63 0d 09 69 |disposal| proc..i|
|000005e0| 73 20 74 6f 20 62 65 20 | 63 61 6c 6c 65 64 20 77 |s to be |called w|
|000005f0| 68 65 6e 20 61 20 68 61 | 6e 64 6c 65 72 20 69 73 |hen a ha|ndler is|
|00000600| 20 72 65 6d 6f 76 65 64 | 2e 20 20 54 68 65 79 20 | removed|. They |
|00000610| 61 72 65 20 74 65 6d 70 | 6f 72 61 72 69 6c 79 20 |are temp|orarily |
|00000620| 73 65 74 0d 09 66 61 6c | 73 65 20 77 68 65 6e 20 |set..fal|se when |
|00000630| 68 61 6e 64 6c 65 72 73 | 20 61 72 65 20 69 6e 73 |handlers| are ins|
|00000640| 74 61 6c 6c 65 64 20 66 | 6f 72 20 77 69 6e 64 6f |talled f|or windo|
|00000650| 77 73 20 6f 72 20 6d 65 | 6e 75 73 20 74 68 61 74 |ws or me|nus that|
|00000660| 20 61 6c 72 65 61 64 79 | 0d 09 68 61 76 65 20 68 | already|..have h|
|00000670| 61 6e 64 6c 65 72 73 20 | 2d 20 74 68 65 20 6f 6c |andlers |- the ol|
|00000680| 64 20 68 61 6e 64 6c 65 | 72 20 69 73 20 72 65 6d |d handle|r is rem|
|00000690| 6f 76 65 64 20 57 49 54 | 48 4f 55 54 20 63 61 6c |oved WIT|HOUT cal|
|000006a0| 6c 69 6e 67 20 74 68 65 | 0d 09 64 69 73 70 6f 73 |ling the|..dispos|
|000006b0| 61 6c 20 70 72 6f 63 2e | 0d 0d 09 44 65 66 61 75 |al proc.|...Defau|
|000006c0| 6c 74 20 6c 6f 77 65 72 | 20 6c 69 6d 69 74 73 20 |lt lower| limits |
|000006d0| 6f 6e 20 77 69 6e 64 6f | 77 20 73 69 7a 69 6e 67 |on windo|w sizing|
|000006e0| 20 6f 66 20 38 30 20 70 | 69 78 65 6c 73 20 62 6f | of 80 p|ixels bo|
|000006f0| 74 68 20 64 69 72 65 63 | 74 69 6f 6e 73 20 69 73 |th direc|tions is|
|00000700| 0d 09 73 75 66 66 69 63 | 69 65 6e 74 20 74 6f 20 |..suffic|ient to |
|00000710| 61 6c 6c 6f 77 20 74 65 | 78 74 20 77 69 6e 64 6f |allow te|xt windo|
|00000720| 77 73 20 72 6f 6f 6d 20 | 74 6f 20 64 72 61 77 20 |ws room |to draw |
|00000730| 61 20 67 72 6f 77 20 62 | 6f 78 20 61 6e 64 20 73 |a grow b|ox and s|
|00000740| 63 72 6f 6c 6c 0d 09 62 | 61 72 73 20 77 69 74 68 |croll..b|ars with|
|00000750| 6f 75 74 20 68 61 76 69 | 6e 67 20 74 68 65 20 74 |out havi|ng the t|
|00000760| 68 75 6d 62 20 61 6e 64 | 20 61 72 72 6f 77 73 20 |humb and| arrows |
|00000770| 6f 76 65 72 6c 61 70 2e | 20 20 54 68 65 73 65 20 |overlap.| These |
|00000780| 76 61 6c 75 65 73 20 6d | 61 79 0d 09 62 65 20 63 |values m|ay..be c|
|00000790| 68 61 6e 67 65 64 20 69 | 66 20 73 75 63 68 20 61 |hanged i|f such a|
|000007a0| 20 63 6f 6e 73 74 72 61 | 69 6e 74 20 69 73 20 75 | constra|int is u|
|000007b0| 6e 64 65 73 69 72 61 62 | 6c 65 20 77 69 74 68 20 |ndesirab|le with |
|000007c0| 53 6b 65 6c 47 72 6f 77 | 42 6f 75 6e 64 73 2e 0d |SkelGrow|Bounds..|
|000007d0| 09 44 65 66 61 75 6c 74 | 20 75 70 70 65 72 20 6c |.Default| upper l|
|000007e0| 69 6d 69 74 73 20 61 72 | 65 20 66 6f 72 20 74 68 |imits ar|e for th|
|000007f0| 65 20 4d 61 63 69 6e 74 | 6f 73 68 2c 20 6e 6f 74 |e Macint|osh, not|
|00000800| 20 74 68 65 20 4c 69 73 | 61 2c 20 62 75 74 20 61 | the Lis|a, but a|
|00000810| 72 65 20 73 65 74 0d 09 | 70 65 72 20 6d 61 63 68 |re set..|per mach|
|00000820| 69 6e 65 20 69 6e 20 53 | 6b 65 6c 49 6e 69 74 2e |ine in S|kelInit.|
|00000830| 0d 2a 2f 0d 0d 74 79 70 | 65 64 65 66 20 73 74 72 |.*/..typ|edef str|
|00000840| 75 63 74 20 57 48 61 6e | 64 6c 65 72 0d 7b 0d 09 |uct WHan|dler.{..|
|00000850| 57 69 6e 64 6f 77 50 74 | 72 09 77 68 57 69 6e 64 |WindowPt|r.whWind|
|00000860| 3b 09 09 09 09 09 09 2f | 2a 20 77 69 6e 64 6f 77 |;....../|* window|
|00000870| 2f 64 69 61 6c 6f 67 20 | 74 6f 20 62 65 20 68 61 |/dialog |to be ha|
|00000880| 6e 64 6c 65 64 09 2a 2f | 0d 23 69 66 64 65 66 20 |ndled.*/|.#ifdef |
|00000890| 61 70 70 6c 65 63 0d 09 | 76 6f 69 64 09 28 2a 77 |applec..|void.(*w|
|000008a0| 68 43 6c 6f 62 62 65 72 | 29 28 76 6f 69 64 29 3b |hClobber|)(void);|
|000008b0| 09 09 09 09 2f 2a 20 64 | 61 74 61 20 73 74 72 75 |..../* d|ata stru|
|000008c0| 63 74 75 72 65 20 64 69 | 73 70 6f 73 61 6c 20 70 |cture di|sposal p|
|000008d0| 72 6f 63 20 2a 2f 0d 09 | 76 6f 69 64 09 28 2a 77 |roc */..|void.(*w|
|000008e0| 68 4d 6f 75 73 65 29 28 | 50 6f 69 6e 74 2c 20 6c |hMouse)(|Point, l|
|000008f0| 6f 6e 67 2c 20 73 68 6f | 72 74 29 3b 09 2f 2a 20 |ong, sho|rt);./* |
|00000900| 6d 6f 75 73 65 2d 63 6c | 69 63 6b 20 68 61 6e 64 |mouse-cl|ick hand|
|00000910| 6c 65 72 20 70 72 6f 63 | 09 09 2a 2f 0d 09 76 6f |ler proc|..*/..vo|
|00000920| 69 64 09 28 2a 77 68 4b | 65 79 29 28 63 68 61 72 |id.(*whK|ey)(char|
|00000930| 2c 20 75 6e 73 69 67 6e | 65 64 20 63 68 61 72 2c |, unsign|ed char,|
|00000940| 20 73 68 6f 72 74 29 3b | 09 2f 2a 20 6b 65 79 2d | short);|./* key-|
|00000950| 63 6c 69 63 6b 20 68 61 | 6e 64 6c 65 72 20 70 72 |click ha|ndler pr|
|00000960| 6f 63 20 2a 2f 0d 09 76 | 6f 69 64 09 28 2a 77 68 |oc */..v|oid.(*wh|
|00000970| 55 70 64 61 74 65 29 28 | 42 6f 6f 6c 65 61 6e 2c |Update)(|Boolean,|
|00000980| 20 73 68 6f 72 74 29 3b | 09 2f 2a 20 75 70 64 61 | short);|./* upda|
|00000990| 74 65 20 68 61 6e 64 6c | 65 72 20 70 72 6f 63 09 |te handl|er proc.|
|000009a0| 09 09 2a 2f 0d 09 76 6f | 69 64 09 28 2a 77 68 41 |..*/..vo|id.(*whA|
|000009b0| 63 74 69 76 61 74 65 29 | 28 42 6f 6f 6c 65 61 6e |ctivate)|(Boolean|
|000009c0| 29 3b 09 09 09 2f 2a 20 | 61 63 74 69 76 61 74 65 |);.../* |activate|
|000009d0| 20 65 76 65 6e 74 20 68 | 61 6e 64 6c 65 72 20 70 | event h|andler p|
|000009e0| 72 6f 63 09 2a 2f 0d 09 | 76 6f 69 64 09 28 2a 77 |roc.*/..|void.(*w|
|000009f0| 68 43 6c 6f 73 65 29 28 | 76 6f 69 64 29 3b 09 09 |hClose)(|void);..|
|00000a00| 09 09 2f 2a 20 63 6c 6f | 73 65 20 22 65 76 65 6e |../* clo|se "even|
|00000a10| 74 22 20 68 61 6e 64 6c | 65 72 20 70 72 6f 63 09 |t" handl|er proc.|
|00000a20| 2a 2f 0d 09 76 6f 69 64 | 09 28 2a 77 68 49 64 6c |*/..void|.(*whIdl|
|00000a30| 65 29 28 76 6f 69 64 29 | 3b 09 09 09 09 2f 2a 20 |e)(void)|;..../* |
|00000a40| 6d 61 69 6e 20 6c 6f 6f | 70 20 70 72 6f 63 09 09 |main loo|p proc..|
|00000a50| 09 09 2a 2f 0d 23 69 66 | 64 65 66 09 73 75 70 70 |..*/.#if|def.supp|
|00000a60| 6f 72 74 44 69 61 6c 6f | 67 73 0d 09 42 6f 6f 6c |ortDialo|gs..Bool|
|00000a70| 65 61 6e 09 28 2a 77 68 | 45 76 65 6e 74 29 28 73 |ean.(*wh|Event)(s|
|00000a80| 68 6f 72 74 20 2a 2c 20 | 45 76 65 6e 74 52 65 63 |hort *, |EventRec|
|00000a90| 6f 72 64 20 2a 29 3b 2f | 2a 20 65 76 65 6e 74 20 |ord *);/|* event |
|00000aa0| 68 6f 6f 6b 09 09 09 09 | 2a 2f 0d 09 42 6f 6f 6c |hook....|*/..Bool|
|00000ab0| 65 61 6e 09 28 2a 77 68 | 43 68 65 63 6b 29 28 73 |ean.(*wh|Check)(s|
|00000ac0| 68 6f 72 74 29 3b 09 09 | 09 09 2f 2a 20 68 69 74 |hort);..|../* hit|
|00000ad0| 20 6e 6f 74 69 66 79 20 | 09 09 09 09 09 2a 2f 0d | notify |.....*/.|
|00000ae0| 23 65 6e 64 69 66 0d 23 | 65 6c 73 65 0d 09 76 6f |#endif.#|else..vo|
|00000af0| 69 64 09 28 2a 77 68 43 | 6c 6f 62 62 65 72 29 28 |id.(*whC|lobber)(|
|00000b00| 29 3b 09 09 2f 2a 20 64 | 61 74 61 20 73 74 72 75 |);../* d|ata stru|
|00000b10| 63 74 75 72 65 20 64 69 | 73 70 6f 73 61 6c 20 70 |cture di|sposal p|
|00000b20| 72 6f 63 20 2a 2f 0d 09 | 76 6f 69 64 09 28 2a 77 |roc */..|void.(*w|
|00000b30| 68 4d 6f 75 73 65 29 28 | 29 3b 09 09 2f 2a 20 6d |hMouse)(|);../* m|
|00000b40| 6f 75 73 65 2d 63 6c 69 | 63 6b 20 68 61 6e 64 6c |ouse-cli|ck handl|
|00000b50| 65 72 20 70 72 6f 63 09 | 09 2a 2f 0d 09 76 6f 69 |er proc.|.*/..voi|
|00000b60| 64 09 28 2a 77 68 4b 65 | 79 29 28 29 3b 09 09 09 |d.(*whKe|y)();...|
|00000b70| 2f 2a 20 6b 65 79 2d 63 | 6c 69 63 6b 20 68 61 6e |/* key-c|lick han|
|00000b80| 64 6c 65 72 20 70 72 6f | 63 09 09 2a 2f 0d 09 76 |dler pro|c..*/..v|
|00000b90| 6f 69 64 09 28 2a 77 68 | 55 70 64 61 74 65 29 28 |oid.(*wh|Update)(|
|00000ba0| 29 3b 09 09 2f 2a 20 75 | 70 64 61 74 65 20 68 61 |);../* u|pdate ha|
|00000bb0| 6e 64 6c 65 72 20 70 72 | 6f 63 09 09 09 2a 2f 0d |ndler pr|oc...*/.|
|00000bc0| 09 76 6f 69 64 09 28 2a | 77 68 41 63 74 69 76 61 |.void.(*|whActiva|
|00000bd0| 74 65 29 28 29 3b 09 2f | 2a 20 61 63 74 69 76 61 |te)();./|* activa|
|00000be0| 74 65 20 65 76 65 6e 74 | 20 68 61 6e 64 6c 65 72 |te event| handler|
|00000bf0| 20 70 72 6f 63 09 2a 2f | 0d 09 76 6f 69 64 09 28 | proc.*/|..void.(|
|00000c00| 2a 77 68 43 6c 6f 73 65 | 29 28 29 3b 09 09 2f 2a |*whClose|)();../*|
|00000c10| 20 63 6c 6f 73 65 20 22 | 65 76 65 6e 74 22 20 68 | close "|event" h|
|00000c20| 61 6e 64 6c 65 72 20 70 | 72 6f 63 09 2a 2f 0d 09 |andler p|roc.*/..|
|00000c30| 76 6f 69 64 09 28 2a 77 | 68 49 64 6c 65 29 28 29 |void.(*w|hIdle)()|
|00000c40| 3b 09 09 2f 2a 20 6d 61 | 69 6e 20 6c 6f 6f 70 20 |;../* ma|in loop |
|00000c50| 70 72 6f 63 09 09 09 09 | 2a 2f 0d 23 69 66 64 65 |proc....|*/.#ifde|
|00000c60| 66 09 73 75 70 70 6f 72 | 74 44 69 61 6c 6f 67 73 |f.suppor|tDialogs|
|00000c70| 0d 09 42 6f 6f 6c 65 61 | 6e 09 28 2a 77 68 45 76 |..Boolea|n.(*whEv|
|00000c80| 65 6e 74 29 28 29 3b 09 | 09 2f 2a 20 65 76 65 6e |ent)();.|./* even|
|00000c90| 74 20 68 6f 6f 6b 09 09 | 09 09 09 2a 2f 0d 09 42 |t hook..|...*/..B|
|00000ca0| 6f 6f 6c 65 61 6e 09 28 | 2a 77 68 43 68 65 63 6b |oolean.(|*whCheck|
|00000cb0| 29 28 29 3b 09 09 2f 2a | 20 68 69 74 20 6e 6f 74 |)();../*| hit not|
|00000cc0| 69 66 79 09 09 09 09 09 | 2a 2f 0d 23 65 6e 64 69 |ify.....|*/.#endi|
|00000cd0| 66 0d 23 65 6e 64 69 66 | 0d 09 52 65 63 74 09 09 |f.#endif|..Rect..|
|00000ce0| 77 68 47 72 6f 77 3b 09 | 09 09 2f 2a 20 6c 69 6d |whGrow;.|../* lim|
|00000cf0| 69 74 73 20 6f 6e 20 77 | 69 6e 64 6f 77 20 73 69 |its on w|indow si|
|00000d00| 7a 69 6e 67 09 09 09 2a | 2f 0d 09 52 67 6e 48 61 |zing...*|/..RgnHa|
|00000d10| 6e 64 6c 65 09 77 68 43 | 75 72 73 6f 72 52 67 6e |ndle.whC|ursorRgn|
|00000d20| 3b 09 2f 2a 20 63 75 72 | 73 6f 72 20 72 65 67 69 |;./* cur|sor regi|
|00000d30| 6f 6e 20 77 68 65 6e 20 | 66 72 6f 6e 74 20 77 69 |on when |front wi|
|00000d40| 6e 64 6f 77 09 2a 2f 0d | 09 43 75 72 73 48 61 6e |ndow.*/.|.CursHan|
|00000d50| 64 6c 65 09 77 68 43 75 | 72 73 6f 72 3b 09 09 2f |dle.whCu|rsor;../|
|00000d60| 2a 20 63 75 72 73 6f 72 | 20 74 6f 20 73 68 6f 77 |* cursor| to show|
|00000d70| 20 77 68 69 6c 65 20 69 | 6e 20 72 65 67 69 6f 6e | while i|n region|
|00000d80| 09 2a 2f 0d 09 6c 6f 6e | 67 09 09 75 73 65 72 52 |.*/..lon|g..userR|
|00000d90| 65 66 65 72 65 6e 63 65 | 3b 09 2f 2a 20 61 20 75 |eference|;./* a u|
|00000da0| 73 65 72 20 73 70 65 63 | 69 66 69 65 64 20 6c 6f |ser spec|ified lo|
|00000db0| 6e 67 77 6f 72 64 09 09 | 2a 2f 0d 09 73 68 6f 72 |ngword..|*/..shor|
|00000dc0| 74 09 09 77 68 53 69 7a | 65 64 4d 6f 64 73 3b 09 |t..whSiz|edMods;.|
|00000dd0| 2f 2a 20 6b 65 79 73 20 | 68 65 6c 64 20 64 6f 77 |/* keys |held dow|
|00000de0| 6e 20 77 68 69 6c 65 20 | 77 69 6e 64 6f 77 20 77 |n while |window w|
|00000df0| 61 73 20 72 65 73 69 7a | 65 64 20 2a 2f 0d 23 69 |as resiz|ed */.#i|
|00000e00| 66 64 65 66 20 73 75 70 | 70 6f 72 74 44 69 61 6c |fdef sup|portDial|
|00000e10| 6f 67 73 0d 09 73 68 6f | 72 74 09 09 77 68 49 74 |ogs..sho|rt..whIt|
|00000e20| 65 6d 48 69 74 3b 09 09 | 2f 2a 20 74 68 65 20 6c |emHit;..|/* the l|
|00000e30| 61 73 74 20 69 74 65 6d | 20 68 69 74 20 69 6e 20 |ast item| hit in |
|00000e40| 74 68 69 73 20 64 69 61 | 6c 6f 67 20 2a 2f 0d 09 |this dia|log */..|
|00000e50| 42 6f 6f 6c 65 61 6e 09 | 09 77 68 4d 6f 64 61 6c |Boolean.|.whModal|
|00000e60| 3b 09 09 2f 2a 20 74 72 | 65 61 74 20 74 68 69 73 |;../* tr|eat this|
|00000e70| 20 61 73 20 61 20 6d 6f | 64 61 6c 20 64 69 61 6c | as a mo|dal dial|
|00000e80| 6f 67 3f 09 2a 2f 0d 23 | 65 6e 64 69 66 0d 09 42 |og?.*/.#|endif..B|
|00000e90| 6f 6f 6c 65 61 6e 09 09 | 77 68 43 61 6e 47 72 6f |oolean..|whCanGro|
|00000ea0| 77 3b 09 09 2f 2a 20 74 | 68 69 73 20 77 69 6e 64 |w;../* t|his wind|
|00000eb0| 6f 77 20 2a 63 61 6e 2a | 20 62 65 20 67 72 6f 77 |ow *can*| be grow|
|00000ec0| 6e 21 21 09 09 2a 2f 0d | 09 42 6f 6f 6c 65 61 6e |n!!..*/.|.Boolean|
|00000ed0| 09 09 77 68 53 69 7a 65 | 64 3b 09 09 2f 2a 20 74 |..whSize|d;../* t|
|00000ee0| 72 75 65 20 3d 20 77 69 | 6e 64 6f 77 20 77 61 73 |rue = wi|ndow was|
|00000ef0| 20 72 65 73 69 7a 65 64 | 09 09 2a 2f 0d 09 42 6f | resized|..*/..Bo|
|00000f00| 6f 6c 65 61 6e 09 09 77 | 68 46 72 6f 6e 74 4f 6e |olean..w|hFrontOn|
|00000f10| 6c 79 3b 09 2f 2a 20 74 | 72 75 65 20 3d 20 69 64 |ly;./* t|rue = id|
|00000f20| 6c 65 20 6f 6e 6c 79 20 | 77 68 65 6e 20 61 63 74 |le only |when act|
|00000f30| 69 76 65 09 09 2a 2f 0d | 09 42 6f 6f 6c 65 61 6e |ive..*/.|.Boolean|
|00000f40| 09 09 77 68 48 61 76 65 | 43 75 72 73 6f 72 3b 09 |..whHave|Cursor;.|
|00000f50| 2f 2a 20 63 75 72 73 6f | 72 20 61 73 73 6f 63 69 |/* curso|r associ|
|00000f60| 61 74 65 64 20 77 69 74 | 68 20 74 68 69 73 20 77 |ated wit|h this w|
|00000f70| 69 6e 64 6f 77 20 2a 2f | 0d 09 73 74 72 75 63 74 |indow */|..struct|
|00000f80| 20 57 48 61 6e 64 6c 65 | 72 09 2a 2a 77 68 4e 65 | WHandle|r.**whNe|
|00000f90| 78 74 3b 09 2f 2a 20 6e | 65 78 74 20 77 69 6e 64 |xt;./* n|ext wind|
|00000fa0| 6f 77 20 68 61 6e 64 6c | 65 72 09 09 09 09 2a 2f |ow handl|er....*/|
|00000fb0| 0d 7d 20 57 48 61 6e 64 | 6c 65 72 3b 0d 0d 73 74 |.} WHand|ler;..st|
|00000fc0| 61 74 69 63 20 57 48 61 | 6e 64 6c 65 72 09 2a 2a |atic WHa|ndler.**|
|00000fd0| 77 68 4c 69 73 74 20 3d | 20 6e 69 6c 3b 0d 73 74 |whList =| nil;.st|
|00000fe0| 61 74 69 63 20 42 6f 6f | 6c 65 61 6e 09 77 68 43 |atic Boo|lean.whC|
|00000ff0| 6c 6f 62 4f 6e 52 6d 76 | 65 20 3d 20 74 72 75 65 |lobOnRmv|e = true|
|00001000| 3b 0d 73 74 61 74 69 63 | 20 52 65 63 74 09 09 67 |;.static| Rect..g|
|00001010| 72 6f 77 52 65 63 74 3b | 0d 73 74 61 74 69 63 20 |rowRect;|.static |
|00001020| 73 68 6f 72 74 20 6d 42 | 61 72 48 65 69 67 68 74 |short mB|arHeight|
|00001030| 3b 09 2f 2a 20 6d 65 6e | 75 20 62 61 72 20 68 65 |;./* men|u bar he|
|00001040| 69 67 68 74 2e 20 20 41 | 6c 6c 20 77 69 6e 64 6f |ight. A|ll windo|
|00001050| 77 20 73 69 7a 69 6e 67 | 0d 09 09 09 09 09 09 09 |w sizing|........|
|00001060| 20 20 63 6f 64 65 20 74 | 61 6b 65 73 20 74 68 69 | code t|akes thi|
|00001070| 73 20 69 6e 74 6f 20 61 | 63 63 6f 75 6e 74 20 2a |s into a|ccount *|
|00001080| 2f 0d 0d 73 74 61 74 69 | 63 20 52 67 6e 48 61 6e |/..stati|c RgnHan|
|00001090| 64 6c 65 20 63 75 72 73 | 6f 72 52 67 6e 3b 09 09 |dle curs|orRgn;..|
|000010a0| 2f 2a 20 75 73 65 20 74 | 68 69 73 20 74 6f 20 6d |/* use t|his to m|
|000010b0| 61 6e 61 67 65 20 74 68 | 65 20 63 75 72 73 6f 72 |anage th|e cursor|
|000010c0| 20 2a 2f 0d 73 74 61 74 | 69 63 20 52 67 6e 48 61 | */.stat|ic RgnHa|
|000010d0| 6e 64 6c 65 20 73 63 72 | 65 65 6e 73 52 67 6e 3b |ndle scr|eensRgn;|
|000010e0| 0d 73 74 61 74 69 63 20 | 42 6f 6f 6c 65 61 6e 20 |.static |Boolean |
|000010f0| 75 73 65 57 61 69 74 4e | 65 78 74 45 76 65 6e 74 |useWaitN|extEvent|
|00001100| 3b 0d 73 74 61 74 69 63 | 20 53 79 73 45 6e 76 52 |;.static| SysEnvR|
|00001110| 65 63 20 73 6b 65 6c 45 | 6e 76 52 65 63 3b 0d 0d |ec skelE|nvRec;..|
|00001120| 74 79 70 65 64 65 66 20 | 73 74 72 75 63 74 20 4d |typedef |struct M|
|00001130| 48 61 6e 64 6c 65 72 0d | 7b 0d 09 73 68 6f 72 74 |Handler.|{..short|
|00001140| 09 09 09 6d 68 49 44 3b | 09 09 09 09 09 09 2f 2a |...mhID;|....../*|
|00001150| 20 6d 65 6e 75 20 69 64 | 20 20 20 20 20 20 20 20 | menu id| |
|00001160| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2a 2f 0d | | */.|
|00001170| 23 69 66 64 65 66 20 61 | 70 70 6c 65 63 0d 09 76 |#ifdef a|pplec..v|
|00001180| 6f 69 64 09 09 09 28 2a | 6d 68 53 65 6c 65 63 74 |oid...(*|mhSelect|
|00001190| 29 28 73 68 6f 72 74 29 | 3b 09 09 09 2f 2a 20 69 |)(short)|;.../* i|
|000011a0| 74 65 6d 20 73 65 6c 65 | 63 74 69 6f 6e 20 68 61 |tem sele|ction ha|
|000011b0| 6e 64 6c 65 72 20 70 72 | 6f 63 20 2a 2f 0d 09 76 |ndler pr|oc */..v|
|000011c0| 6f 69 64 09 09 09 28 2a | 6d 68 43 6c 6f 62 62 65 |oid...(*|mhClobbe|
|000011d0| 72 29 28 4d 65 6e 75 48 | 61 6e 64 6c 65 29 3b 09 |r)(MenuH|andle);.|
|000011e0| 2f 2a 20 6d 65 6e 75 20 | 64 69 73 70 6f 73 61 6c |/* menu |disposal|
|000011f0| 20 68 61 6e 64 6c 65 72 | 20 70 72 6f 63 20 20 2a | handler| proc *|
|00001200| 2f 0d 23 65 6c 73 65 0d | 09 76 6f 69 64 09 09 09 |/.#else.|.void...|
|00001210| 28 2a 6d 68 53 65 6c 65 | 63 74 29 28 29 3b 09 09 |(*mhSele|ct)();..|
|00001220| 09 2f 2a 20 69 74 65 6d | 20 73 65 6c 65 63 74 69 |./* item| selecti|
|00001230| 6f 6e 20 68 61 6e 64 6c | 65 72 20 70 72 6f 63 20 |on handl|er proc |
|00001240| 2a 2f 0d 09 76 6f 69 64 | 09 09 09 28 2a 6d 68 43 |*/..void|...(*mhC|
|00001250| 6c 6f 62 62 65 72 29 28 | 29 3b 09 09 09 2f 2a 20 |lobber)(|);.../* |
|00001260| 6d 65 6e 75 20 64 69 73 | 70 6f 73 61 6c 20 68 61 |menu dis|posal ha|
|00001270| 6e 64 6c 65 72 20 70 72 | 6f 63 20 20 2a 2f 0d 23 |ndler pr|oc */.#|
|00001280| 65 6e 64 69 66 0d 09 73 | 74 72 75 63 74 20 4d 48 |endif..s|truct MH|
|00001290| 61 6e 64 6c 65 72 09 2a | 2a 6d 68 4e 65 78 74 3b |andler.*|*mhNext;|
|000012a0| 09 09 09 09 09 2f 2a 20 | 6e 65 78 74 20 6d 65 6e |...../* |next men|
|000012b0| 75 20 68 61 6e 64 6c 65 | 72 20 20 20 20 20 20 20 |u handle|r |
|000012c0| 20 20 20 20 2a 2f 0d 7d | 20 4d 48 61 6e 64 6c 65 | */.}| MHandle|
|000012d0| 72 3b 0d 0d 0d 73 74 61 | 74 69 63 20 4d 48 61 6e |r;...sta|tic MHan|
|000012e0| 64 6c 65 72 09 2a 2a 6d | 68 4c 69 73 74 20 3d 20 |dler.**m|hList = |
|000012f0| 6e 69 6c 3b 09 09 09 2f | 2a 20 6c 69 73 74 20 6f |nil;.../|* list o|
|00001300| 66 20 6d 65 6e 75 20 68 | 61 6e 64 6c 65 72 73 20 |f menu h|andlers |
|00001310| 2a 2f 0d 73 74 61 74 69 | 63 20 42 6f 6f 6c 65 61 |*/.stati|c Boolea|
|00001320| 6e 09 6d 68 43 6c 6f 62 | 4f 6e 52 6d 76 65 20 3d |n.mhClob|OnRmve =|
|00001330| 20 74 72 75 65 3b 0d 0d | 0d 2f 2a 0d 09 56 61 72 | true;..|./*..Var|
|00001340| 69 61 62 6c 65 73 20 66 | 6f 72 20 64 65 66 61 75 |iables f|or defau|
|00001350| 6c 74 20 41 70 70 6c 65 | 20 6d 65 6e 75 20 68 61 |lt Apple| menu ha|
|00001360| 6e 64 6c 65 72 2e 20 20 | 61 70 70 6c 65 49 44 20 |ndler. |appleID |
|00001370| 69 73 20 73 65 74 20 74 | 6f 20 31 20 69 66 0d 09 |is set t|o 1 if..|
|00001380| 53 6b 65 6c 41 70 70 6c | 65 20 69 73 20 63 61 6c |SkelAppl|e is cal|
|00001390| 6c 65 64 20 61 6e 64 20 | 69 73 20 74 68 65 20 69 |led and |is the i|
|000013a0| 64 20 6f 66 20 74 68 65 | 20 41 70 70 6c 65 20 6d |d of the| Apple m|
|000013b0| 65 6e 75 2c 20 61 70 70 | 6c 65 41 62 6f 75 74 50 |enu, app|leAboutP|
|000013c0| 72 6f 63 0d 09 69 73 20 | 74 68 65 20 70 72 6f 63 |roc..is |the proc|
|000013d0| 65 64 75 72 65 20 74 6f | 20 65 78 65 63 75 74 65 |edure to| execute|
|000013e0| 20 69 66 20 74 68 65 72 | 65 20 69 73 20 61 6e 20 | if ther|e is an |
|000013f0| 41 62 6f 75 74 2e 2e 2e | 20 69 74 65 6d 20 61 6e |About...| item an|
|00001400| 64 20 69 74 27 73 0d 09 | 63 68 6f 73 65 6e 20 66 |d it's..|chosen f|
|00001410| 72 6f 6d 20 74 68 65 20 | 41 70 70 6c 65 20 6d 65 |rom the |Apple me|
|00001420| 6e 75 2e 20 20 49 66 20 | 64 6f 41 62 6f 75 74 20 |nu. If |doAbout |
|00001430| 69 73 20 74 72 75 65 2c | 20 74 68 65 6e 20 74 68 |is true,| then th|
|00001440| 65 20 6d 65 6e 75 0d 09 | 63 6f 6e 74 61 69 6e 73 |e menu..|contains|
|00001450| 20 74 68 65 20 41 62 6f | 75 74 2e 2e 2e 20 69 74 | the Abo|ut... it|
|00001460| 65 6d 2c 20 6f 74 68 65 | 72 77 69 73 65 20 69 74 |em, othe|rwise it|
|00001470| 27 73 20 6a 75 73 74 20 | 64 65 73 6b 20 61 63 63 |'s just |desk acc|
|00001480| 65 73 73 6f 72 69 65 73 | 2e 0d 2a 2f 0d 0d 73 74 |essories|..*/..st|
|00001490| 61 74 69 63 20 4d 65 6e | 75 48 61 6e 64 6c 65 09 |atic Men|uHandle.|
|000014a0| 61 70 70 6c 65 4d 65 6e | 75 3b 0d 73 74 61 74 69 |appleMen|u;.stati|
|000014b0| 63 20 73 68 6f 72 74 09 | 09 61 70 70 6c 65 49 44 |c short.|.appleID|
|000014c0| 20 3d 20 30 3b 0d 23 69 | 66 64 65 66 20 61 70 70 | = 0;.#i|fdef app|
|000014d0| 6c 65 63 0d 73 74 61 74 | 69 63 20 76 6f 69 64 09 |lec.stat|ic void.|
|000014e0| 09 09 28 2a 61 70 70 6c | 65 41 62 6f 75 74 50 72 |..(*appl|eAboutPr|
|000014f0| 6f 63 29 28 76 6f 69 64 | 29 20 3d 20 6e 69 6c 3b |oc)(void|) = nil;|
|00001500| 0d 73 74 61 74 69 63 20 | 76 6f 69 64 09 09 09 28 |.static |void...(|
|00001510| 2a 61 70 70 6c 65 48 65 | 6c 70 50 72 6f 63 29 28 |*appleHe|lpProc)(|
|00001520| 76 6f 69 64 29 20 3d 20 | 6e 69 6c 3b 0d 23 65 6c |void) = |nil;.#el|
|00001530| 73 65 0d 73 74 61 74 69 | 63 20 76 6f 69 64 09 09 |se.stati|c void..|
|00001540| 09 28 2a 61 70 70 6c 65 | 41 62 6f 75 74 50 72 6f |.(*apple|AboutPro|
|00001550| 63 29 28 29 20 3d 20 6e | 69 6c 3b 0d 73 74 61 74 |c)() = n|il;.stat|
|00001560| 69 63 20 76 6f 69 64 09 | 09 09 28 2a 61 70 70 6c |ic void.|..(*appl|
|00001570| 65 48 65 6c 70 50 72 6f | 63 29 28 29 20 3d 20 6e |eHelpPro|c)() = n|
|00001580| 69 6c 3b 0d 23 65 6e 64 | 69 66 0d 73 74 61 74 69 |il;.#end|if.stati|
|00001590| 63 20 42 6f 6f 6c 65 61 | 6e 09 09 64 6f 41 62 6f |c Boolea|n..doAbo|
|000015a0| 75 74 20 3d 20 66 61 6c | 73 65 3b 0d 73 74 61 74 |ut = fal|se;.stat|
|000015b0| 69 63 20 42 6f 6f 6c 65 | 61 6e 09 09 64 6f 48 65 |ic Boole|an..doHe|
|000015c0| 6c 70 20 3d 20 66 61 6c | 73 65 3b 0d 2f 2a 0d 09 |lp = fal|se;./*..|
|000015d0| 4d 69 73 63 65 6c 6c 61 | 6e 65 6f 75 73 0d 0d 09 |Miscella|neous...|
|000015e0| 73 63 72 65 65 6e 50 6f | 72 74 20 70 6f 69 6e 74 |screenPo|rt point|
|000015f0| 73 20 74 6f 20 74 68 65 | 20 77 69 6e 64 6f 77 20 |s to the| window |
|00001600| 6d 61 6e 61 67 65 72 20 | 70 6f 72 74 2e 0d 09 0d |manager |port....|
|00001610| 09 64 6f 6e 65 46 6c 61 | 67 20 64 65 74 65 72 6d |.doneFla|g determ|
|00001620| 69 6e 65 73 20 77 68 65 | 6e 20 53 6b 65 6c 4d 61 |ines whe|n SkelMa|
|00001630| 69 6e 20 72 65 74 75 72 | 6e 73 2e 20 20 49 74 20 |in retur|ns. It |
|00001640| 69 73 20 73 65 74 20 62 | 79 20 63 61 6c 6c 69 6e |is set b|y callin|
|00001650| 67 0d 09 53 6b 65 6c 57 | 68 6f 61 28 29 2c 20 77 |g..SkelW|hoa(), w|
|00001660| 68 69 63 68 20 74 68 65 | 20 68 6f 73 74 20 64 6f |hich the| host do|
|00001670| 65 73 20 74 6f 20 72 65 | 71 75 65 73 74 20 61 20 |es to re|quest a |
|00001680| 68 61 6c 74 2e 0d 0d 09 | 70 42 6b 67 6e 64 20 70 |halt....|pBkgnd p|
|00001690| 6f 69 6e 74 73 20 74 6f | 20 61 20 62 61 63 6b 67 |oints to| a backg|
|000016a0| 72 6f 75 6e 64 20 70 72 | 6f 63 65 64 75 72 65 2c |round pr|ocedure,|
|000016b0| 20 74 6f 20 62 65 20 72 | 75 6e 20 64 75 72 69 6e | to be r|un durin|
|000016c0| 67 20 65 76 65 6e 74 0d | 09 70 72 6f 63 65 73 73 |g event.|.process|
|000016d0| 69 6e 67 2e 20 20 53 65 | 74 20 69 74 20 77 69 74 |ing. Se|t it wit|
|000016e0| 68 20 53 6b 65 6c 42 61 | 63 6b 67 72 6f 75 6e 64 |h SkelBa|ckground|
|000016f0| 2e 20 20 49 66 20 6e 69 | 6c 2c 20 74 68 65 72 65 |. If ni|l, there|
|00001700| 27 73 20 6e 6f 0d 09 70 | 72 6f 63 65 64 75 72 65 |'s no..p|rocedure|
|00001710| 2e 0d 0d 09 70 45 76 65 | 6e 74 20 70 6f 69 6e 74 |....pEve|nt point|
|00001720| 73 20 74 6f 20 61 6e 20 | 65 76 65 6e 74 2d 69 6e |s to an |event-in|
|00001730| 73 70 65 63 74 69 6e 67 | 20 68 6f 6f 6b 2c 20 74 |specting| hook, t|
|00001740| 6f 20 62 65 20 72 75 6e | 20 77 68 65 6e 65 76 65 |o be run| wheneve|
|00001750| 72 20 61 6e 0d 09 65 76 | 65 6e 74 20 6f 63 63 75 |r an..ev|ent occu|
|00001760| 72 73 2e 20 20 53 65 74 | 20 69 74 20 77 69 74 68 |rs. Set| it with|
|00001770| 20 53 6b 65 6c 45 76 65 | 6e 74 48 6f 6f 6b 2e 20 | SkelEve|ntHook. |
|00001780| 20 49 66 20 6e 69 6c 2c | 20 74 68 65 72 65 27 73 | If nil,| there's|
|00001790| 20 6e 6f 0d 09 70 72 6f | 63 65 64 75 72 65 2e 0d | no..pro|cedure..|
|000017a0| 0d 09 65 76 65 6e 74 4d | 61 73 6b 20 63 6f 6e 74 |..eventM|ask cont|
|000017b0| 72 6f 6c 73 20 74 68 65 | 20 65 76 65 6e 74 20 74 |rols the| event t|
|000017c0| 79 70 65 73 20 72 65 71 | 75 65 73 74 65 64 20 69 |ypes req|uested i|
|000017d0| 6e 20 74 68 65 20 47 65 | 74 4e 65 78 74 45 76 65 |n the Ge|tNextEve|
|000017e0| 6e 74 0d 09 63 61 6c 6c | 20 69 6e 20 53 6b 65 6c |nt..call| in Skel|
|000017f0| 4d 61 69 6e 2e 0d 0d 09 | 64 69 73 6b 49 6e 69 74 |Main....|diskInit|
|00001800| 50 74 20 69 73 20 74 68 | 65 20 6c 6f 63 61 74 69 |Pt is th|e locati|
|00001810| 6f 6e 20 61 74 20 77 68 | 69 63 68 20 74 68 65 20 |on at wh|ich the |
|00001820| 64 69 73 6b 20 69 6e 69 | 74 69 61 6c 69 7a 61 74 |disk ini|tializat|
|00001830| 69 6f 6e 20 64 69 61 6c | 6f 67 0d 09 61 70 70 65 |ion dial|og..appe|
|00001840| 61 72 73 2c 20 69 66 20 | 61 6e 20 75 6e 69 6e 69 |ars, if |an unini|
|00001850| 74 69 61 6c 69 7a 65 64 | 20 64 69 73 6b 20 69 73 |tialized| disk is|
|00001860| 20 69 6e 73 65 72 74 65 | 64 2e 0d 2a 2f 0d 0d 73 | inserte|d..*/..s|
|00001870| 74 61 74 69 63 20 47 72 | 61 66 50 74 72 09 73 63 |tatic Gr|afPtr.sc|
|00001880| 72 65 65 6e 50 6f 72 74 | 3b 0d 73 74 61 74 69 63 |reenPort|;.static|
|00001890| 20 42 6f 6f 6c 65 61 6e | 09 64 6f 6e 65 46 6c 61 | Boolean|.doneFla|
|000018a0| 67 20 3d 20 66 61 6c 73 | 65 3b 0d 0d 23 69 66 64 |g = fals|e;..#ifd|
|000018b0| 65 66 20 61 70 70 6c 65 | 63 0d 73 74 61 74 69 63 |ef apple|c.static|
|000018c0| 20 42 6f 6f 6c 65 61 6e | 09 28 2a 70 45 76 65 6e | Boolean|.(*pEven|
|000018d0| 74 29 28 45 76 65 6e 74 | 52 65 63 6f 72 64 20 2a |t)(Event|Record *|
|000018e0| 29 20 3d 20 6e 69 6c 3b | 0d 73 74 61 74 69 63 20 |) = nil;|.static |
|000018f0| 76 6f 69 64 09 09 28 2a | 70 42 6b 67 6e 64 29 28 |void..(*|pBkgnd)(|
|00001900| 76 6f 69 64 29 20 3d 20 | 6e 69 6c 3b 0d 23 65 6c |void) = |nil;.#el|
|00001910| 73 65 0d 73 74 61 74 69 | 63 20 42 6f 6f 6c 65 61 |se.stati|c Boolea|
|00001920| 6e 09 28 2a 70 45 76 65 | 6e 74 29 28 29 20 3d 20 |n.(*pEve|nt)() = |
|00001930| 6e 69 6c 3b 0d 73 74 61 | 74 69 63 20 76 6f 69 64 |nil;.sta|tic void|
|00001940| 09 09 28 2a 70 42 6b 67 | 6e 64 29 28 29 20 3d 20 |..(*pBkg|nd)() = |
|00001950| 6e 69 6c 3b 0d 23 65 6e | 64 69 66 0d 73 74 61 74 |nil;.#en|dif.stat|
|00001960| 69 63 20 6c 6f 6e 67 20 | 09 70 46 47 54 69 6d 65 |ic long |.pFGTime|
|00001970| 20 3d 20 36 4c 3b 09 09 | 09 2f 2a 20 74 65 6e 74 | = 6L;..|./* tent|
|00001980| 68 20 6f 66 20 61 20 73 | 65 63 6f 6e 64 20 2a 2f |h of a s|econd */|
|00001990| 0d 73 74 61 74 69 63 20 | 6c 6f 6e 67 09 09 70 42 |.static |long..pB|
|000019a0| 47 54 69 6d 65 20 3d 20 | 33 30 30 4c 3b 09 09 09 |GTime = |300L;...|
|000019b0| 2f 2a 20 35 20 73 65 63 | 6f 6e 64 73 20 2a 2f 0d |/* 5 sec|onds */.|
|000019c0| 73 74 61 74 69 63 20 42 | 6f 6f 6c 65 61 6e 09 66 |static B|oolean.f|
|000019d0| 67 41 70 70 20 3d 20 74 | 72 75 65 3b 09 09 09 2f |gApp = t|rue;.../|
|000019e0| 2a 20 68 61 6e 64 6c 65 | 20 73 75 73 70 65 6e 64 |* handle| suspend|
|000019f0| 2f 72 65 73 75 6d 65 20 | 65 76 65 6e 74 73 20 2a |/resume |events *|
|00001a00| 2f 0d 0d 73 74 61 74 69 | 63 20 73 68 6f 72 74 09 |/..stati|c short.|
|00001a10| 65 76 65 6e 74 4d 61 73 | 6b 20 3d 20 65 76 65 72 |eventMas|k = ever|
|00001a20| 79 45 76 65 6e 74 20 5e | 20 6b 65 79 55 70 4d 61 |yEvent ^| keyUpMa|
|00001a30| 73 6b 3b 0d 73 74 61 74 | 69 63 20 50 6f 69 6e 74 |sk;.stat|ic Point|
|00001a40| 09 64 69 73 6b 49 6e 69 | 74 50 74 20 3d 20 7b 20 |.diskIni|tPt = { |
|00001a50| 2f 2a 20 76 20 3d 20 2a | 2f 20 31 32 30 2c 20 2f |/* v = *|/ 120, /|
|00001a60| 2a 20 68 20 3d 20 2a 2f | 20 31 30 30 20 7d 3b 0d |* h = */| 100 };.|
|00001a70| 0d 23 69 66 64 65 66 20 | 61 70 70 6c 65 63 0d 73 |.#ifdef |applec.s|
|00001a80| 74 61 74 69 63 20 76 6f | 69 64 20 28 2a 70 53 63 |tatic vo|id (*pSc|
|00001a90| 72 61 70 43 6f 6e 76 65 | 72 74 29 28 42 6f 6f 6c |rapConve|rt)(Bool|
|00001aa0| 65 61 6e 29 20 3d 20 6e | 69 6c 3b 0d 73 74 61 74 |ean) = n|il;.stat|
|00001ab0| 69 63 20 76 6f 69 64 20 | 28 2a 70 53 75 73 70 65 |ic void |(*pSuspe|
|00001ac0| 6e 64 52 65 73 75 6d 65 | 29 28 42 6f 6f 6c 65 61 |ndResume|)(Boolea|
|00001ad0| 6e 29 20 3d 20 6e 69 6c | 3b 0d 73 74 61 74 69 63 |n) = nil|;.static|
|00001ae0| 20 76 6f 69 64 20 28 2a | 70 5a 6f 6f 6d 50 72 6f | void (*|pZoomPro|
|00001af0| 63 29 28 57 69 6e 64 6f | 77 50 74 72 2c 20 73 68 |c)(Windo|wPtr, sh|
|00001b00| 6f 72 74 2c 20 73 68 6f | 72 74 2c 20 42 6f 6f 6c |ort, sho|rt, Bool|
|00001b10| 65 61 6e 29 20 3d 20 6e | 69 6c 3b 0d 73 74 61 74 |ean) = n|il;.stat|
|00001b20| 69 63 20 76 6f 69 64 20 | 28 2a 70 4e 65 74 77 6f |ic void |(*pNetwo|
|00001b30| 72 6b 50 72 6f 63 29 28 | 45 76 65 6e 74 52 65 63 |rkProc)(|EventRec|
|00001b40| 6f 72 64 20 2a 29 20 3d | 20 6e 69 6c 3b 0d 73 74 |ord *) =| nil;.st|
|00001b50| 61 74 69 63 20 76 6f 69 | 64 20 28 2a 70 43 68 69 |atic voi|d (*pChi|
|00001b60| 6c 64 44 69 65 64 29 28 | 45 76 65 6e 74 52 65 63 |ldDied)(|EventRec|
|00001b70| 6f 72 64 20 2a 29 20 3d | 20 6e 69 6c 3b 0d 73 74 |ord *) =| nil;.st|
|00001b80| 61 74 69 63 20 76 6f 69 | 64 20 28 2a 70 48 61 6e |atic voi|d (*pHan|
|00001b90| 64 6c 65 41 70 70 34 29 | 28 45 76 65 6e 74 52 65 |dleApp4)|(EventRe|
|00001ba0| 63 6f 72 64 20 2a 29 20 | 3d 20 6e 69 6c 3b 0d 23 |cord *) |= nil;.#|
|00001bb0| 65 6c 73 65 0d 73 74 61 | 74 69 63 20 76 6f 69 64 |else.sta|tic void|
|00001bc0| 20 28 2a 70 53 63 72 61 | 70 43 6f 6e 76 65 72 74 | (*pScra|pConvert|
|00001bd0| 29 28 29 20 3d 20 6e 69 | 6c 3b 0d 73 74 61 74 69 |)() = ni|l;.stati|
|00001be0| 63 20 76 6f 69 64 20 28 | 2a 70 53 75 73 70 65 6e |c void (|*pSuspen|
|00001bf0| 64 52 65 73 75 6d 65 29 | 28 29 20 3d 20 6e 69 6c |dResume)|() = nil|
|00001c00| 3b 0d 73 74 61 74 69 63 | 20 76 6f 69 64 20 28 2a |;.static| void (*|
|00001c10| 70 5a 6f 6f 6d 50 72 6f | 63 29 28 29 20 3d 20 6e |pZoomPro|c)() = n|
|00001c20| 69 6c 3b 0d 73 74 61 74 | 69 63 20 76 6f 69 64 20 |il;.stat|ic void |
|00001c30| 28 2a 70 4e 65 74 77 6f | 72 6b 50 72 6f 63 29 28 |(*pNetwo|rkProc)(|
|00001c40| 29 20 3d 20 6e 69 6c 3b | 0d 73 74 61 74 69 63 20 |) = nil;|.static |
|00001c50| 76 6f 69 64 20 28 2a 70 | 43 68 69 6c 64 44 69 65 |void (*p|ChildDie|
|00001c60| 64 29 28 29 20 3d 20 6e | 69 6c 3b 0d 73 74 61 74 |d)() = n|il;.stat|
|00001c70| 69 63 20 76 6f 69 64 20 | 28 2a 70 48 61 6e 64 6c |ic void |(*pHandl|
|00001c80| 65 41 70 70 34 29 28 29 | 20 3d 20 6e 69 6c 3b 0d |eApp4)()| = nil;.|
|00001c90| 23 65 6e 64 69 66 0d 0d | 23 69 66 64 65 66 09 73 |#endif..|#ifdef.s|
|00001ca0| 75 70 70 6f 72 74 44 69 | 61 6c 6f 67 73 0d 0d 2f |upportDi|alogs../|
|00001cb0| 2a 0d 09 45 76 65 6e 74 | 73 20 74 68 61 74 20 61 |*..Event|s that a|
|00001cc0| 72 65 20 70 61 73 73 65 | 64 20 74 6f 20 64 69 61 |re passe|d to dia|
|00001cd0| 6c 6f 67 73 2e 20 20 4f | 74 68 65 72 73 20 61 72 |logs. O|thers ar|
|00001ce0| 65 20 69 67 6e 6f 72 65 | 64 2e 0d 09 53 74 61 6e |e ignore|d...Stan|
|00001cf0| 64 61 72 64 20 6d 61 73 | 6b 20 70 61 73 73 65 73 |dard mas|k passes|
|00001d00| 20 2c 20 6d 6f 75 73 65 | 64 6f 77 6e 2c 20 6b 65 | , mouse|down, ke|
|00001d10| 79 64 6f 77 6e 2c 20 61 | 75 74 6f 6b 65 79 2c 20 |ydown, a|utokey, |
|00001d20| 75 70 64 61 74 65 2c 0d | 09 61 63 74 69 76 61 74 |update,.|.activat|
|00001d30| 65 20 61 6e 64 20 6e 75 | 6c 6c 20 65 76 65 6e 74 |e and nu|ll event|
|00001d40| 73 2e 20 20 4e 75 6c 6c | 20 65 76 65 6e 74 73 20 |s. Null| events |
|00001d50| 61 72 65 20 63 6f 6e 74 | 72 6f 6c 6c 65 64 20 62 |are cont|rolled b|
|00001d60| 79 20 62 69 74 20 30 2e | 0d 2a 2f 0d 0d 73 74 61 |y bit 0.|.*/..sta|
|00001d70| 74 69 63 20 73 68 6f 72 | 74 09 64 6c 6f 67 45 76 |tic shor|t.dlogEv|
|00001d80| 65 6e 74 4d 61 73 6b 20 | 3d 20 30 78 31 36 62 3b |entMask |= 0x16b;|
|00001d90| 0d 0d 23 65 6e 64 69 66 | 0d 0d 2f 2a 20 2d 2d 2d |..#endif|../* ---|
|00001da0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001db0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001dc0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001dd0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001de0| 2d 20 2a 2f 0d 2f 2a 09 | 09 09 09 09 09 49 6e 74 |- */./*.|.....Int|
|00001df0| 65 72 6e 61 6c 20 28 70 | 72 69 76 61 74 65 29 20 |ernal (p|rivate) |
|00001e00| 52 6f 75 74 69 6e 65 73 | 09 09 09 09 09 09 2a 2f |Routines|......*/|
|00001e10| 0d 2f 2a 20 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |./* ----|--------|
|00001e20| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001e30| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001e40| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001e50| 2d 2d 2d 2d 2d 2d 2d 2d | 20 2a 2f 0d 0d 2f 2a 0d |--------| */../*.|
|00001e60| 09 47 65 74 20 68 61 6e | 64 6c 65 72 20 61 73 73 |.Get han|dler ass|
|00001e70| 6f 63 69 61 74 65 64 20 | 77 69 74 68 20 75 73 65 |ociated |with use|
|00001e80| 72 20 6f 72 20 64 69 61 | 6c 6f 67 20 77 69 6e 64 |r or dia|log wind|
|00001e90| 6f 77 2e 0d 09 52 65 74 | 75 72 6e 20 6e 69 6c 20 |ow...Ret|urn nil |
|00001ea0| 69 66 20 77 69 6e 64 6f | 77 20 64 6f 65 73 6e 27 |if windo|w doesn'|
|00001eb0| 74 20 62 65 6c 6f 6e 67 | 20 74 6f 20 61 6e 79 20 |t belong| to any |
|00001ec0| 6b 6e 6f 77 6e 20 68 61 | 6e 64 6c 65 72 2e 0d 09 |known ha|ndler...|
|00001ed0| 54 68 69 73 20 72 6f 75 | 74 69 6e 65 20 69 73 20 |This rou|tine is |
|00001ee0| 61 62 73 6f 6c 75 74 65 | 6c 79 20 66 75 6e 64 61 |absolute|ly funda|
|00001ef0| 6d 65 6e 74 61 6c 20 74 | 6f 20 54 72 61 6e 73 53 |mental t|o TransS|
|00001f00| 6b 65 6c 2e 0d 2a 2f 0d | 0d 57 48 61 6e 64 6c 65 |kel..*/.|.WHandle|
|00001f10| 72 20 2a 2a 47 65 74 57 | 44 48 61 6e 64 6c 65 72 |r **GetW|DHandler|
|00001f20| 20 28 57 69 6e 64 6f 77 | 50 74 72 29 3b 0d 73 74 | (Window|Ptr);.st|
|00001f30| 61 74 69 63 20 57 48 61 | 6e 64 6c 65 72 20 2a 2a |atic WHa|ndler **|
|00001f40| 47 65 74 57 44 48 61 6e | 64 6c 65 72 20 28 74 68 |GetWDHan|dler (th|
|00001f50| 65 57 69 6e 64 29 0d 57 | 69 6e 64 6f 77 50 74 72 |eWind).W|indowPtr|
|00001f60| 09 74 68 65 57 69 6e 64 | 3b 0d 7b 0d 09 72 65 67 |.theWind|;.{..reg|
|00001f70| 69 73 74 65 72 20 57 48 | 61 6e 64 6c 65 72 09 2a |ister WH|andler.*|
|00001f80| 2a 68 3b 0d 0d 09 69 66 | 20 28 74 68 65 57 69 6e |*h;...if| (theWin|
|00001f90| 64 29 20 7b 0d 09 09 66 | 6f 72 20 28 68 20 3d 20 |d) {...f|or (h = |
|00001fa0| 77 68 4c 69 73 74 3b 20 | 68 20 21 3d 20 6e 69 6c |whList; |h != nil|
|00001fb0| 3b 20 68 20 3d 20 28 2a | 2a 68 29 2e 77 68 4e 65 |; h = (*|*h).whNe|
|00001fc0| 78 74 29 20 7b 0d 09 09 | 09 69 66 20 28 28 2a 2a |xt) {...|.if ((**|
|00001fd0| 68 29 2e 77 68 57 69 6e | 64 20 3d 3d 20 74 68 65 |h).whWin|d == the|
|00001fe0| 57 69 6e 64 29 20 7b 0d | 09 09 09 09 72 65 74 75 |Wind) {.|....retu|
|00001ff0| 72 6e 20 28 68 29 3b 0d | 09 09 09 7d 0d 09 09 7d |rn (h);.|...}...}|
|00002000| 0d 09 7d 0d 09 72 65 74 | 75 72 6e 20 28 6e 69 6c |..}..ret|urn (nil|
|00002010| 29 3b 0d 7d 0d 0d 0d 2f | 2a 0d 09 47 65 74 20 68 |);.}.../|*..Get h|
|00002020| 61 6e 64 6c 65 72 20 61 | 73 73 6f 63 69 61 74 65 |andler a|ssociate|
|00002030| 64 20 77 69 74 68 20 75 | 73 65 72 20 77 69 6e 64 |d with u|ser wind|
|00002040| 6f 77 2e 0d 09 52 65 74 | 75 72 6e 20 6e 69 6c 20 |ow...Ret|urn nil |
|00002050| 69 66 20 77 69 6e 64 6f | 77 20 64 6f 65 73 6e 27 |if windo|w doesn'|
|00002060| 74 20 62 65 6c 6f 6e 67 | 20 74 6f 20 61 6e 79 20 |t belong| to any |
|00002070| 6b 6e 6f 77 6e 20 68 61 | 6e 64 6c 65 72 2e 0d 09 |known ha|ndler...|
|00002080| 54 68 65 20 6f 72 64 65 | 72 20 6f 66 20 74 68 65 |The orde|r of the|
|00002090| 20 74 77 6f 20 74 65 73 | 74 73 20 69 73 20 63 72 | two tes|ts is cr|
|000020a0| 69 74 69 63 61 6c 3a 20 | 20 74 68 65 57 69 6e 64 |itical: | theWind|
|000020b0| 20 6d 69 67 68 74 20 62 | 65 20 6e 69 6c 2e 0d 2a | might b|e nil..*|
|000020c0| 2f 0d 0d 57 48 61 6e 64 | 6c 65 72 20 2a 2a 47 65 |/..WHand|ler **Ge|
|000020d0| 74 57 48 61 6e 64 6c 65 | 72 20 28 57 69 6e 64 6f |tWHandle|r (Windo|
|000020e0| 77 50 74 72 29 3b 0d 73 | 74 61 74 69 63 20 57 48 |wPtr);.s|tatic WH|
|000020f0| 61 6e 64 6c 65 72 20 2a | 2a 47 65 74 57 48 61 6e |andler *|*GetWHan|
|00002100| 64 6c 65 72 20 28 74 68 | 65 57 69 6e 64 29 0d 57 |dler (th|eWind).W|
|00002110| 69 6e 64 6f 77 50 74 72 | 09 74 68 65 57 69 6e 64 |indowPtr|.theWind|
|00002120| 3b 0d 7b 0d 09 72 65 67 | 69 73 74 65 72 20 57 48 |;.{..reg|ister WH|
|00002130| 61 6e 64 6c 65 72 09 2a | 2a 68 3b 0d 0d 09 69 66 |andler.*|*h;...if|
|00002140| 20 28 28 68 20 3d 20 47 | 65 74 57 44 48 61 6e 64 | ((h = G|etWDHand|
|00002150| 6c 65 72 20 28 74 68 65 | 57 69 6e 64 29 29 20 21 |ler (the|Wind)) !|
|00002160| 3d 20 6e 69 6c 0d 09 09 | 26 26 20 28 28 57 69 6e |= nil...|&& ((Win|
|00002170| 64 6f 77 50 65 65 6b 29 | 20 74 68 65 57 69 6e 64 |dowPeek)| theWind|
|00002180| 29 2d 3e 77 69 6e 64 6f | 77 4b 69 6e 64 20 21 3d |)->windo|wKind !=|
|00002190| 20 64 69 61 6c 6f 67 4b | 69 6e 64 29 20 7b 0d 09 | dialogK|ind) {..|
|000021a0| 09 72 65 74 75 72 6e 20 | 28 68 29 3b 0d 09 7d 0d |.return |(h);..}.|
|000021b0| 09 72 65 74 75 72 6e 20 | 28 6e 69 6c 29 3b 0d 7d |.return |(nil);.}|
|000021c0| 0d 0d 23 69 66 64 65 66 | 09 73 75 70 70 6f 72 74 |..#ifdef|.support|
|000021d0| 44 69 61 6c 6f 67 73 0d | 0d 2f 2a 0d 09 47 65 74 |Dialogs.|./*..Get|
|000021e0| 20 68 61 6e 64 6c 65 72 | 20 61 73 73 6f 63 69 61 | handler| associa|
|000021f0| 74 65 64 20 77 69 74 68 | 20 64 69 61 6c 6f 67 20 |ted with| dialog |
|00002200| 77 69 6e 64 6f 77 2e 0d | 09 52 65 74 75 72 6e 20 |window..|.Return |
|00002210| 6e 69 6c 20 69 66 20 77 | 69 6e 64 6f 77 20 64 6f |nil if w|indow do|
|00002220| 65 73 6e 27 74 20 62 65 | 6c 6f 6e 67 20 74 6f 20 |esn't be|long to |
|00002230| 61 6e 79 20 6b 6e 6f 77 | 6e 20 68 61 6e 64 6c 65 |any know|n handle|
|00002240| 72 2e 0d 09 54 68 65 20 | 6f 72 64 65 72 20 6f 66 |r...The |order of|
|00002250| 20 74 68 65 20 74 77 6f | 20 74 65 73 74 73 20 69 | the two| tests i|
|00002260| 73 20 63 72 69 74 69 63 | 61 6c 3a 20 20 74 68 65 |s critic|al: the|
|00002270| 44 69 61 6c 6f 67 20 6d | 69 67 68 74 20 62 65 20 |Dialog m|ight be |
|00002280| 6e 69 6c 2e 0d 2a 2f 0d | 0d 57 48 61 6e 64 6c 65 |nil..*/.|.WHandle|
|00002290| 72 20 2a 2a 47 65 74 44 | 48 61 6e 64 6c 65 72 20 |r **GetD|Handler |
|000022a0| 28 44 69 61 6c 6f 67 50 | 74 72 29 3b 0d 73 74 61 |(DialogP|tr);.sta|
|000022b0| 74 69 63 20 57 48 61 6e | 64 6c 65 72 20 2a 2a 47 |tic WHan|dler **G|
|000022c0| 65 74 44 48 61 6e 64 6c | 65 72 20 28 74 68 65 44 |etDHandl|er (theD|
|000022d0| 69 61 6c 6f 67 29 0d 44 | 69 61 6c 6f 67 50 74 72 |ialog).D|ialogPtr|
|000022e0| 09 74 68 65 44 69 61 6c | 6f 67 3b 0d 7b 0d 09 72 |.theDial|og;.{..r|
|000022f0| 65 67 69 73 74 65 72 20 | 57 48 61 6e 64 6c 65 72 |egister |WHandler|
|00002300| 09 2a 2a 68 3b 0d 0d 09 | 69 66 20 28 28 68 20 3d |.**h;...|if ((h =|
|00002310| 20 47 65 74 57 44 48 61 | 6e 64 6c 65 72 20 28 74 | GetWDHa|ndler (t|
|00002320| 68 65 44 69 61 6c 6f 67 | 29 29 20 21 3d 20 6e 69 |heDialog|)) != ni|
|00002330| 6c 0d 09 09 26 26 20 28 | 28 57 69 6e 64 6f 77 50 |l...&& (|(WindowP|
|00002340| 65 65 6b 29 20 74 68 65 | 44 69 61 6c 6f 67 29 2d |eek) the|Dialog)-|
|00002350| 3e 77 69 6e 64 6f 77 4b | 69 6e 64 20 3d 3d 20 64 |>windowK|ind == d|
|00002360| 69 61 6c 6f 67 4b 69 6e | 64 29 0d 09 7b 0d 09 09 |ialogKin|d)..{...|
|00002370| 09 72 65 74 75 72 6e 20 | 28 68 29 3b 0d 09 7d 0d |.return |(h);..}.|
|00002380| 09 72 65 74 75 72 6e 20 | 28 6e 69 6c 29 3b 0d 7d |.return |(nil);.}|
|00002390| 0d 0d 23 65 6e 64 69 66 | 0d 0d 20 20 73 74 61 74 |..#endif|.. stat|
|000023a0| 69 63 20 57 48 61 6e 64 | 6c 65 72 20 2a 2a 0d 53 |ic WHand|ler **.S|
|000023b0| 6b 65 6c 4e 75 6c 6c 48 | 61 6e 64 6c 65 72 20 28 |kelNullH|andler (|
|000023c0| 74 68 65 57 69 6e 29 0d | 09 57 69 6e 64 6f 77 50 |theWin).|.WindowP|
|000023d0| 74 72 20 74 68 65 57 69 | 6e 3b 0d 7b 0d 09 72 65 |tr theWi|n;.{..re|
|000023e0| 67 69 73 74 65 72 20 57 | 48 61 6e 64 6c 65 72 09 |gister W|Handler.|
|000023f0| 2a 2a 68 3b 0d 09 69 66 | 20 28 68 20 3d 20 4e 65 |**h;..if| (h = Ne|
|00002400| 77 20 28 57 48 61 6e 64 | 6c 65 72 29 29 20 7b 0d |w (WHand|ler)) {.|
|00002410| 09 09 28 2a 2a 68 29 2e | 77 68 57 69 6e 64 20 3d |..(**h).|whWind =|
|00002420| 20 74 68 65 57 69 6e 3b | 0d 09 09 28 2a 2a 68 29 | theWin;|...(**h)|
|00002430| 2e 77 68 4d 6f 75 73 65 | 20 3d 20 6e 69 6c 3b 0d |.whMouse| = nil;.|
|00002440| 09 09 28 2a 2a 68 29 2e | 77 68 4b 65 79 20 3d 20 |..(**h).|whKey = |
|00002450| 6e 69 6c 3b 0d 09 09 28 | 2a 2a 68 29 2e 77 68 55 |nil;...(|**h).whU|
|00002460| 70 64 61 74 65 20 3d 20 | 6e 69 6c 3b 0d 09 09 28 |pdate = |nil;...(|
|00002470| 2a 2a 68 29 2e 77 68 41 | 63 74 69 76 61 74 65 20 |**h).whA|ctivate |
|00002480| 3d 20 6e 69 6c 3b 0d 09 | 09 28 2a 2a 68 29 2e 77 |= nil;..|.(**h).w|
|00002490| 68 43 6c 6f 73 65 20 3d | 20 6e 69 6c 3b 0d 09 09 |hClose =| nil;...|
|000024a0| 28 2a 2a 68 29 2e 77 68 | 43 6c 6f 62 62 65 72 20 |(**h).wh|Clobber |
|000024b0| 3d 20 6e 69 6c 3b 0d 09 | 09 28 2a 2a 68 29 2e 77 |= nil;..|.(**h).w|
|000024c0| 68 49 64 6c 65 20 3d 20 | 6e 69 6c 3b 0d 09 09 28 |hIdle = |nil;...(|
|000024d0| 2a 2a 68 29 2e 77 68 46 | 72 6f 6e 74 4f 6e 6c 79 |**h).whF|rontOnly|
|000024e0| 20 3d 20 74 72 75 65 3b | 0d 09 09 28 2a 2a 68 29 | = true;|...(**h)|
|000024f0| 2e 77 68 53 69 7a 65 64 | 20 3d 20 66 61 6c 73 65 |.whSized| = false|
|00002500| 3b 0d 09 09 28 2a 2a 68 | 29 2e 77 68 53 69 7a 65 |;...(**h|).whSize|
|00002510| 64 4d 6f 64 73 20 3d 20 | 30 3b 0d 09 09 28 2a 2a |dMods = |0;...(**|
|00002520| 68 29 2e 77 68 47 72 6f | 77 20 3d 20 67 72 6f 77 |h).whGro|w = grow|
|00002530| 52 65 63 74 3b 0d 09 09 | 28 2a 2a 68 29 2e 77 68 |Rect;...|(**h).wh|
|00002540| 43 61 6e 47 72 6f 77 20 | 3d 20 74 72 75 65 3b 0d |CanGrow |= true;.|
|00002550| 09 09 28 2a 2a 68 29 2e | 77 68 48 61 76 65 43 75 |..(**h).|whHaveCu|
|00002560| 72 73 6f 72 20 3d 20 66 | 61 6c 73 65 3b 0d 09 09 |rsor = f|alse;...|
|00002570| 28 2a 2a 68 29 2e 77 68 | 43 75 72 73 6f 72 52 67 |(**h).wh|CursorRg|
|00002580| 6e 20 3d 20 28 52 67 6e | 48 61 6e 64 6c 65 29 20 |n = (Rgn|Handle) |
|00002590| 30 3b 0d 09 09 28 2a 2a | 68 29 2e 77 68 43 75 72 |0;...(**|h).whCur|
|000025a0| 73 6f 72 20 3d 20 28 43 | 75 72 73 48 61 6e 64 6c |sor = (C|ursHandl|
|000025b0| 65 29 20 30 3b 0d 09 09 | 28 2a 2a 68 29 2e 75 73 |e) 0;...|(**h).us|
|000025c0| 65 72 52 65 66 65 72 65 | 6e 63 65 20 3d 20 30 4c |erRefere|nce = 0L|
|000025d0| 3b 0d 23 69 66 64 65 66 | 20 73 75 70 70 6f 72 74 |;.#ifdef| support|
|000025e0| 44 69 61 6c 6f 67 73 0d | 09 09 28 2a 2a 68 29 2e |Dialogs.|..(**h).|
|000025f0| 77 68 45 76 65 6e 74 20 | 3d 20 6e 69 6c 3b 0d 09 |whEvent |= nil;..|
|00002600| 09 28 2a 2a 68 29 2e 77 | 68 43 68 65 63 6b 20 3d |.(**h).w|hCheck =|
|00002610| 20 6e 69 6c 3b 0d 09 09 | 28 2a 2a 68 29 2e 77 68 | nil;...|(**h).wh|
|00002620| 49 74 65 6d 48 69 74 20 | 3d 20 30 3b 0d 09 09 28 |ItemHit |= 0;...(|
|00002630| 2a 2a 68 29 2e 77 68 4d | 6f 64 61 6c 20 3d 20 66 |**h).whM|odal = f|
|00002640| 61 6c 73 65 3b 0d 23 65 | 6e 64 69 66 0d 09 09 2f |alse;.#e|ndif.../|
|00002650| 2a 20 61 64 64 20 74 68 | 69 73 20 69 6e 74 6f 20 |* add th|is into |
|00002660| 74 68 65 20 77 69 6e 64 | 6f 77 20 6c 69 73 74 21 |the wind|ow list!|
|00002670| 20 2a 2f 0d 09 09 28 2a | 2a 68 29 2e 77 68 4e 65 | */...(*|*h).whNe|
|00002680| 78 74 20 3d 20 77 68 4c | 69 73 74 3b 0d 09 09 77 |xt = whL|ist;...w|
|00002690| 68 4c 69 73 74 20 3d 20 | 68 3b 0d 09 7d 0d 09 72 |hList = |h;..}..r|
|000026a0| 65 74 75 72 6e 20 28 68 | 29 3b 0d 7d 0d 0d 20 20 |eturn (h|);.}.. |
|000026b0| 76 6f 69 64 0d 53 6b 65 | 6c 44 72 61 67 57 69 6e |void.Ske|lDragWin|
|000026c0| 64 6f 77 20 28 74 68 65 | 57 69 6e 2c 20 70 74 2c |dow (the|Win, pt,|
|000026d0| 20 6d 6f 64 73 2c 20 62 | 6f 75 6e 64 73 29 0d 09 | mods, b|ounds)..|
|000026e0| 57 69 6e 64 6f 77 50 74 | 72 20 74 68 65 57 69 6e |WindowPt|r theWin|
|000026f0| 3b 0d 09 50 6f 69 6e 74 | 20 70 74 3b 0d 09 73 68 |;..Point| pt;..sh|
|00002700| 6f 72 74 20 6d 6f 64 73 | 3b 0d 09 52 65 63 74 20 |ort mods|;..Rect |
|00002710| 2a 62 6f 75 6e 64 73 3b | 0d 7b 0d 09 69 66 20 28 |*bounds;|.{..if (|
|00002720| 21 28 6d 6f 64 73 20 26 | 20 63 6d 64 4b 65 79 29 |!(mods &| cmdKey)|
|00002730| 29 20 7b 0d 09 09 53 65 | 6c 65 63 74 57 69 6e 64 |) {...Se|lectWind|
|00002740| 6f 77 20 28 74 68 65 57 | 69 6e 29 3b 0d 09 09 53 |ow (theW|in);...S|
|00002750| 65 74 50 6f 72 74 20 28 | 74 68 65 57 69 6e 29 3b |etPort (|theWin);|
|00002760| 0d 09 09 69 66 20 28 21 | 53 74 69 6c 6c 44 6f 77 |...if (!|StillDow|
|00002770| 6e 20 28 29 29 0d 09 09 | 09 72 65 74 75 72 6e 3b |n ())...|.return;|
|00002780| 0d 09 7d 0d 09 44 72 61 | 67 57 69 6e 64 6f 77 20 |..}..Dra|gWindow |
|00002790| 28 74 68 65 57 69 6e 2c | 20 70 74 2c 20 62 6f 75 |(theWin,| pt, bou|
|000027a0| 6e 64 73 29 3b 0d 7d 0d | 0d 2f 2a 0d 09 52 65 6d |nds);.}.|./*..Rem|
|000027b0| 6f 76 65 20 61 20 6d 65 | 6e 75 20 68 61 6e 64 6c |ove a me|nu handl|
|000027c0| 65 72 2e 20 20 54 68 69 | 73 20 63 61 6c 6c 73 20 |er. Thi|s calls |
|000027d0| 74 68 65 20 68 61 6e 64 | 6c 65 72 27 73 20 64 69 |the hand|ler's di|
|000027e0| 73 70 6f 73 61 6c 20 72 | 6f 75 74 69 6e 65 0d 09 |sposal r|outine..|
|000027f0| 61 6e 64 20 74 68 65 6e | 20 74 61 6b 65 73 20 74 |and then| takes t|
|00002800| 68 65 20 68 61 6e 64 6c | 65 72 20 6f 75 74 20 6f |he handl|er out o|
|00002810| 66 20 74 68 65 20 68 61 | 6e 64 6c 65 72 20 6c 69 |f the ha|ndler li|
|00002820| 73 74 20 61 6e 64 20 64 | 69 73 70 6f 73 65 73 0d |st and d|isposes.|
|00002830| 09 6f 66 20 69 74 2e 0d | 0d 09 4e 6f 74 65 20 74 |.of it..|..Note t|
|00002840| 68 61 74 20 74 68 65 20 | 6d 65 6e 75 20 4d 55 53 |hat the |menu MUS|
|00002850| 54 20 62 65 20 64 65 6c | 65 74 65 64 20 66 72 6f |T be del|eted fro|
|00002860| 6d 20 74 68 65 20 6d 65 | 6e 75 20 62 61 72 20 62 |m the me|nu bar b|
|00002870| 65 66 6f 72 65 20 63 61 | 6c 6c 69 6e 67 0d 09 74 |efore ca|lling..t|
|00002880| 68 65 20 63 6c 6f 62 62 | 65 72 20 70 72 6f 63 2c |he clobb|er proc,|
|00002890| 20 62 65 63 61 75 73 65 | 20 74 68 65 20 6d 65 6e | because| the men|
|000028a0| 75 20 62 61 72 20 77 69 | 6c 6c 20 65 6e 64 20 75 |u bar wi|ll end u|
|000028b0| 70 20 66 69 6c 6c 65 64 | 20 77 69 74 68 0d 09 67 |p filled| with..g|
|000028c0| 61 72 62 61 67 65 20 69 | 66 20 74 68 65 20 6d 65 |arbage i|f the me|
|000028d0| 6e 75 20 77 61 73 20 61 | 6c 6c 6f 63 61 74 65 64 |nu was a|llocated|
|000028e0| 20 77 69 74 68 20 4e 65 | 77 4d 65 6e 75 20 28 73 | with Ne|wMenu (s|
|000028f0| 65 65 20 64 69 73 63 75 | 73 73 69 6f 6e 20 6f 66 |ee discu|ssion of|
|00002900| 0d 09 44 69 73 70 6f 73 | 65 4d 65 6e 75 20 69 6e |..Dispos|eMenu in|
|00002910| 20 4d 65 6e 75 20 4d 61 | 6e 61 67 65 72 20 73 65 | Menu Ma|nager se|
|00002920| 63 74 69 6f 6e 20 6f 66 | 20 49 6e 73 69 64 65 20 |ction of| Inside |
|00002930| 4d 61 63 69 6e 74 6f 73 | 68 29 2e 0d 0d 09 54 68 |Macintos|h)....Th|
|00002940| 65 20 6d 65 6e 75 20 62 | 61 72 20 69 73 20 6f 6e |e menu b|ar is on|
|00002950| 6c 79 20 72 65 64 72 61 | 77 6e 20 69 66 20 72 65 |ly redra|wn if re|
|00002960| 64 72 61 77 42 61 72 20 | 69 73 20 74 72 75 65 2d |drawBar |is true-|
|00002970| 2d 74 68 69 73 20 72 65 | 6d 6f 76 65 73 0d 09 74 |-this re|moves..t|
|00002980| 68 65 20 66 6c 69 63 6b | 65 72 20 66 72 6f 6d 20 |he flick|er from |
|00002990| 74 68 65 20 6d 65 6e 75 | 20 62 61 72 20 77 68 65 |the menu| bar whe|
|000029a0| 6e 20 74 68 65 20 61 70 | 70 6c 69 63 61 74 69 6f |n the ap|plicatio|
|000029b0| 6e 20 74 65 72 6d 69 6e | 61 74 65 73 2e 0d 2a 2f |n termin|ates..*/|
|000029c0| 0d 0d 76 6f 69 64 20 52 | 65 6d 6f 76 65 4d 65 6e |..void R|emoveMen|
|000029d0| 75 20 28 4d 65 6e 75 48 | 61 6e 64 6c 65 2c 20 42 |u (MenuH|andle, B|
|000029e0| 6f 6f 6c 65 61 6e 29 3b | 0d 73 74 61 74 69 63 20 |oolean);|.static |
|000029f0| 76 6f 69 64 20 52 65 6d | 6f 76 65 4d 65 6e 75 20 |void Rem|oveMenu |
|00002a00| 28 74 68 65 4d 65 6e 75 | 2c 20 72 65 64 72 61 77 |(theMenu|, redraw|
|00002a10| 42 61 72 29 0d 09 4d 65 | 6e 75 48 61 6e 64 6c 65 |Bar)..Me|nuHandle|
|00002a20| 09 74 68 65 4d 65 6e 75 | 3b 0d 09 42 6f 6f 6c 65 |.theMenu|;..Boole|
|00002a30| 61 6e 09 09 72 65 64 72 | 61 77 42 61 72 3b 0d 7b |an..redr|awBar;.{|
|00002a40| 0d 09 72 65 67 69 73 74 | 65 72 20 73 68 6f 72 74 |..regist|er short|
|00002a50| 09 09 6d 49 44 3b 0d 09 | 72 65 67 69 73 74 65 72 |..mID;..|register|
|00002a60| 20 4d 48 61 6e 64 6c 65 | 72 09 2a 2a 68 2c 20 2a | MHandle|r.**h, *|
|00002a70| 2a 68 32 3b 0d 23 69 66 | 64 65 66 20 61 70 70 6c |*h2;.#if|def appl|
|00002a80| 65 63 0d 09 72 65 67 69 | 73 74 65 72 20 76 6f 69 |ec..regi|ster voi|
|00002a90| 64 09 09 28 2a 70 29 28 | 4d 65 6e 75 48 61 6e 64 |d..(*p)(|MenuHand|
|00002aa0| 6c 65 29 3b 0d 23 65 6c | 73 65 0d 09 72 65 67 69 |le);.#el|se..regi|
|00002ab0| 73 74 65 72 20 76 6f 69 | 64 09 09 28 2a 70 29 28 |ster voi|d..(*p)(|
|00002ac0| 29 3b 0d 23 65 6e 64 69 | 66 0d 0d 09 6d 49 44 20 |);.#endi|f...mID |
|00002ad0| 3d 20 28 2a 2a 74 68 65 | 4d 65 6e 75 29 2e 6d 65 |= (**the|Menu).me|
|00002ae0| 6e 75 49 44 3b 0d 09 2f | 2a 20 69 66 20 6c 69 73 |nuID;../|* if lis|
|00002af0| 74 20 65 6d 70 74 79 2c | 20 69 67 6e 6f 72 65 20 |t empty,| ignore |
|00002b00| 2a 2f 0d 09 69 66 20 28 | 6d 68 4c 69 73 74 20 21 |*/..if (|mhList !|
|00002b10| 3d 20 6e 69 6c 29 20 7b | 0d 09 09 2f 2a 20 69 73 |= nil) {|.../* is|
|00002b20| 20 69 74 20 74 68 65 20 | 66 69 72 73 74 20 65 6c | it the |first el|
|00002b30| 65 6d 65 6e 74 3f 20 2a | 2f 0d 09 09 69 66 20 28 |ement? *|/...if (|
|00002b40| 28 2a 2a 6d 68 4c 69 73 | 74 29 2e 6d 68 49 44 20 |(**mhLis|t).mhID |
|00002b50| 3d 3d 20 6d 49 44 29 20 | 7b 0d 09 09 09 68 32 20 |== mID) |{....h2 |
|00002b60| 3d 20 6d 68 4c 69 73 74 | 3b 0d 09 09 09 6d 68 4c |= mhList|;....mhL|
|00002b70| 69 73 74 20 3d 20 28 2a | 2a 6d 68 4c 69 73 74 29 |ist = (*|*mhList)|
|00002b80| 2e 6d 68 4e 65 78 74 3b | 0d 09 09 7d 0d 09 09 65 |.mhNext;|...}...e|
|00002b90| 6c 73 65 20 7b 0d 09 09 | 09 66 6f 72 20 28 68 20 |lse {...|.for (h |
|00002ba0| 3d 20 6d 68 4c 69 73 74 | 3b 20 68 20 21 3d 20 6e |= mhList|; h != n|
|00002bb0| 69 6c 3b 20 68 20 3d 20 | 68 32 29 20 7b 0d 09 09 |il; h = |h2) {...|
|00002bc0| 09 09 68 32 20 3d 20 28 | 2a 2a 68 29 2e 6d 68 4e |..h2 = (|**h).mhN|
|00002bd0| 65 78 74 3b 0d 09 09 09 | 09 69 66 20 28 68 32 20 |ext;....|.if (h2 |
|00002be0| 3d 3d 20 6e 69 6c 29 0d | 09 09 09 09 09 72 65 74 |== nil).|.....ret|
|00002bf0| 75 72 6e 3b 09 09 09 09 | 09 09 2f 2a 20 6d 65 6e |urn;....|../* men|
|00002c00| 75 20 6e 6f 74 20 69 6e | 20 6c 69 73 74 21 20 2a |u not in| list! *|
|00002c10| 2f 0d 09 09 09 09 69 66 | 20 28 28 2a 2a 68 32 29 |/.....if| ((**h2)|
|00002c20| 2e 6d 68 49 44 20 3d 3d | 20 6d 49 44 29 20 7b 0d |.mhID ==| mID) {.|
|00002c30| 09 09 09 09 09 2f 2a 20 | 66 6f 75 6e 64 20 69 74 |...../* |found it|
|00002c40| 20 2a 2f 0d 09 09 09 09 | 09 28 2a 2a 68 29 2e 6d | */.....|.(**h).m|
|00002c50| 68 4e 65 78 74 20 3d 20 | 28 2a 2a 68 32 29 2e 6d |hNext = |(**h2).m|
|00002c60| 68 4e 65 78 74 3b 0d 09 | 09 09 09 09 62 72 65 61 |hNext;..|....brea|
|00002c70| 6b 3b 0d 09 09 09 09 7d | 0d 09 09 09 7d 0d 09 09 |k;.....}|....}...|
|00002c80| 7d 0d 09 09 44 65 6c 65 | 74 65 4d 65 6e 75 20 28 |}...Dele|teMenu (|
|00002c90| 6d 49 44 29 3b 0d 09 09 | 69 66 20 28 72 65 64 72 |mID);...|if (redr|
|00002ca0| 61 77 42 61 72 29 20 7b | 0d 09 09 09 44 72 61 77 |awBar) {|....Draw|
|00002cb0| 4d 65 6e 75 42 61 72 20 | 28 29 3b 0d 09 09 7d 0d |MenuBar |();...}.|
|00002cc0| 09 09 69 66 20 28 6d 68 | 43 6c 6f 62 4f 6e 52 6d |..if (mh|ClobOnRm|
|00002cd0| 76 65 20 26 26 20 28 70 | 20 3d 20 28 2a 2a 68 32 |ve && (p| = (**h2|
|00002ce0| 29 2e 6d 68 43 6c 6f 62 | 62 65 72 29 20 21 3d 20 |).mhClob|ber) != |
|00002cf0| 6e 69 6c 29 20 7b 0d 09 | 09 09 28 2a 70 29 20 28 |nil) {..|..(*p) (|
|00002d00| 74 68 65 4d 65 6e 75 29 | 3b 09 09 09 09 09 09 2f |theMenu)|;....../|
|00002d10| 2a 20 63 61 6c 6c 20 64 | 69 73 70 6f 73 61 6c 20 |* call d|isposal |
|00002d20| 72 6f 75 74 69 6e 65 20 | 2a 2f 0d 09 09 7d 0d 09 |routine |*/...}..|
|00002d30| 09 44 69 73 70 6f 73 48 | 61 6e 64 6c 65 20 28 28 |.DisposH|andle ((|
|00002d40| 48 61 6e 64 6c 65 29 20 | 68 32 29 3b 09 09 09 09 |Handle) |h2);....|
|00002d50| 2f 2a 20 67 65 74 20 72 | 69 64 20 6f 66 20 68 61 |/* get r|id of ha|
|00002d60| 6e 64 6c 65 72 20 72 65 | 63 6f 72 64 20 2a 2f 0d |ndler re|cord */.|
|00002d70| 09 7d 0d 7d 0d 0d 2f 2a | 0d 09 47 65 6e 65 72 61 |.}.}../*|..Genera|
|00002d80| 6c 20 6d 65 6e 75 2d 68 | 61 6e 64 6c 65 72 2e 20 |l menu-h|andler. |
|00002d90| 20 4a 75 73 74 20 70 61 | 73 73 65 73 20 73 65 6c | Just pa|sses sel|
|00002da0| 65 63 74 69 6f 6e 20 74 | 6f 20 74 68 65 20 68 61 |ection t|o the ha|
|00002db0| 6e 64 6c 65 72 27 73 0d | 09 73 65 6c 65 63 74 20 |ndler's.|.select |
|00002dc0| 72 6f 75 74 69 6e 65 2e | 20 20 49 66 20 74 68 65 |routine.| If the|
|00002dd0| 20 73 65 6c 65 63 74 20 | 72 6f 75 74 69 6e 65 20 | select |routine |
|00002de0| 69 73 20 6e 69 6c 2c 20 | 73 65 6c 65 63 74 69 6e |is nil, |selectin|
|00002df0| 67 20 69 74 65 6d 73 20 | 66 72 6f 6d 0d 09 74 68 |g items |from..th|
|00002e00| 65 20 6d 65 6e 75 20 69 | 73 20 61 20 6e 6f 70 2e |e menu i|s a nop.|
|00002e10| 0d 2a 2f 0d 0d 76 6f 69 | 64 20 44 6f 4d 65 6e 75 |.*/..voi|d DoMenu|
|00002e20| 43 6f 6d 6d 61 6e 64 20 | 28 6c 6f 6e 67 29 3b 0d |Command |(long);.|
|00002e30| 73 74 61 74 69 63 20 76 | 6f 69 64 20 44 6f 4d 65 |static v|oid DoMe|
|00002e40| 6e 75 43 6f 6d 6d 61 6e | 64 20 28 63 6f 6d 6d 61 |nuComman|d (comma|
|00002e50| 6e 64 29 0d 6c 6f 6e 67 | 09 09 63 6f 6d 6d 61 6e |nd).long|..comman|
|00002e60| 64 3b 0d 7b 0d 09 72 65 | 67 69 73 74 65 72 20 73 |d;.{..re|gister s|
|00002e70| 68 6f 72 74 09 09 6d 65 | 6e 75 3b 0d 09 72 65 67 |hort..me|nu;..reg|
|00002e80| 69 73 74 65 72 20 73 68 | 6f 72 74 09 09 69 74 65 |ister sh|ort..ite|
|00002e90| 6d 3b 0d 09 72 65 67 69 | 73 74 65 72 20 4d 48 61 |m;..regi|ster MHa|
|00002ea0| 6e 64 6c 65 72 09 2a 2a | 6d 68 3b 0d 23 69 66 64 |ndler.**|mh;.#ifd|
|00002eb0| 65 66 20 61 70 70 6c 65 | 63 0d 09 72 65 67 69 73 |ef apple|c..regis|
|00002ec0| 74 65 72 20 76 6f 69 64 | 09 09 28 2a 70 29 28 73 |ter void|..(*p)(s|
|00002ed0| 68 6f 72 74 29 3b 0d 23 | 65 6c 73 65 0d 09 72 65 |hort);.#|else..re|
|00002ee0| 67 69 73 74 65 72 20 76 | 6f 69 64 09 09 28 2a 70 |gister v|oid..(*p|
|00002ef0| 29 28 29 3b 0d 23 65 6e | 64 69 66 0d 0d 09 6d 65 |)();.#en|dif...me|
|00002f00| 6e 75 20 3d 20 48 69 57 | 6f 72 64 20 28 63 6f 6d |nu = HiW|ord (com|
|00002f10| 6d 61 6e 64 29 3b 0d 09 | 69 74 65 6d 20 3d 20 4c |mand);..|item = L|
|00002f20| 6f 57 6f 72 64 20 28 63 | 6f 6d 6d 61 6e 64 29 3b |oWord (c|ommand);|
|00002f30| 0d 09 66 6f 72 20 28 6d | 68 20 3d 20 6d 68 4c 69 |..for (m|h = mhLi|
|00002f40| 73 74 3b 20 6d 68 20 21 | 3d 20 6e 69 6c 3b 20 6d |st; mh !|= nil; m|
|00002f50| 68 20 3d 20 28 2a 2a 6d | 68 29 2e 6d 68 4e 65 78 |h = (**m|h).mhNex|
|00002f60| 74 29 20 7b 0d 09 09 69 | 66 20 28 28 6d 65 6e 75 |t) {...i|f ((menu|
|00002f70| 20 3d 3d 20 28 2a 2a 6d | 68 29 2e 6d 68 49 44 29 | == (**m|h).mhID)|
|00002f80| 20 26 26 20 28 28 70 20 | 3d 20 28 2a 2a 6d 68 29 | && ((p |= (**mh)|
|00002f90| 2e 6d 68 53 65 6c 65 63 | 74 29 20 21 3d 20 6e 69 |.mhSelec|t) != ni|
|00002fa0| 6c 29 29 20 7b 0d 09 09 | 09 28 2a 70 29 20 28 69 |l)) {...|.(*p) (i|
|00002fb0| 74 65 6d 29 3b 0d 09 09 | 09 62 72 65 61 6b 3b 0d |tem);...|.break;.|
|00002fc0| 09 09 7d 0d 09 7d 0d 09 | 48 69 6c 69 74 65 4d 65 |..}..}..|HiliteMe|
|00002fd0| 6e 75 20 28 30 29 3b 09 | 09 2f 2a 20 63 6f 6d 6d |nu (0);.|./* comm|
|00002fe0| 61 6e 64 20 64 6f 6e 65 | 2c 20 74 75 72 6e 20 6f |and done|, turn o|
|00002ff0| 66 66 20 6d 65 6e 75 20 | 68 69 6c 69 74 69 6e 67 |ff menu |hiliting|
|00003000| 20 2a 2f 0d 7d 0d 0d 0d | 2f 2a 0d 09 41 70 70 6c | */.}...|/*..Appl|
|00003010| 65 20 6d 65 6e 75 20 68 | 61 6e 64 6c 65 72 0d 09 |e menu h|andler..|
|00003020| 0d 09 44 6f 41 70 70 6c | 65 49 74 65 6d 3a 20 20 |..DoAppl|eItem: |
|00003030| 49 66 20 74 68 65 20 66 | 69 72 73 74 20 69 74 65 |If the f|irst ite|
|00003040| 6d 20 77 61 73 20 63 68 | 6f 73 65 6e 2c 20 61 6e |m was ch|osen, an|
|00003050| 64 20 74 68 65 72 65 27 | 73 20 61 6e 20 22 41 62 |d there'|s an "Ab|
|00003060| 6f 75 74 2e 2e 2e 22 0d | 09 69 74 65 6d 2c 20 63 |out...".|.item, c|
|00003070| 61 6c 6c 20 74 68 65 20 | 70 72 6f 63 65 64 75 72 |all the |procedur|
|00003080| 65 20 61 73 73 6f 63 69 | 61 74 65 64 20 77 69 74 |e associ|ated wit|
|00003090| 68 20 69 74 20 28 69 66 | 20 6e 6f 74 20 6e 69 6c |h it (if| not nil|
|000030a0| 29 2e 20 20 49 66 20 74 | 68 65 72 65 0d 09 69 73 |). If t|here..is|
|000030b0| 20 6e 6f 20 22 41 62 6f | 75 74 2e 2e 2e 22 20 69 | no "Abo|ut..." i|
|000030c0| 74 65 6d 20 6f 72 20 74 | 68 65 20 69 74 65 6d 20 |tem or t|he item |
|000030d0| 77 61 73 20 6e 6f 74 20 | 74 68 65 20 66 69 72 73 |was not |the firs|
|000030e0| 74 20 6f 6e 65 2c 20 74 | 68 65 6e 20 6f 70 65 6e |t one, t|hen open|
|000030f0| 0d 09 74 68 65 20 61 73 | 73 6f 63 69 61 74 65 64 |..the as|sociated|
|00003100| 20 64 65 73 6b 20 61 63 | 63 65 73 73 6f 72 79 2e | desk ac|cessory.|
|00003110| 20 20 54 68 65 20 70 6f | 72 74 20 69 73 20 73 61 | The po|rt is sa|
|00003120| 76 65 64 20 61 6e 64 20 | 72 65 73 74 6f 72 65 64 |ved and |restored|
|00003130| 0d 09 62 65 63 61 75 73 | 65 20 4f 70 65 6e 44 65 |..becaus|e OpenDe|
|00003140| 73 6b 41 63 63 20 64 6f | 65 73 20 6e 6f 74 20 61 |skAcc do|es not a|
|00003150| 6c 77 61 79 73 20 70 72 | 65 73 65 72 76 65 20 69 |lways pr|eserve i|
|00003160| 74 20 63 6f 72 72 65 63 | 74 6c 79 2e 0d 09 0d 09 |t correc|tly.....|
|00003170| 44 6f 41 70 70 6c 65 43 | 6c 6f 62 62 65 72 20 64 |DoAppleC|lobber d|
|00003180| 69 73 70 6f 73 65 73 20 | 6f 66 20 74 68 65 20 41 |isposes |of the A|
|00003190| 70 70 6c 65 20 6d 65 6e | 75 2e 0d 2a 2f 0d 0d 76 |pple men|u..*/..v|
|000031a0| 6f 69 64 20 44 6f 41 70 | 70 6c 65 49 74 65 6d 20 |oid DoAp|pleItem |
|000031b0| 28 73 68 6f 72 74 29 3b | 0d 73 74 61 74 69 63 20 |(short);|.static |
|000031c0| 76 6f 69 64 20 44 6f 41 | 70 70 6c 65 49 74 65 6d |void DoA|ppleItem|
|000031d0| 20 28 69 74 65 6d 29 0d | 09 73 68 6f 72 74 20 69 | (item).|.short i|
|000031e0| 74 65 6d 3b 0d 7b 0d 47 | 72 61 66 50 74 72 09 09 |tem;.{.G|rafPtr..|
|000031f0| 63 75 72 50 6f 72 74 3b | 0d 53 74 72 32 35 35 09 |curPort;|.Str255.|
|00003200| 09 73 74 72 3b 0d 0d 09 | 69 66 20 28 64 6f 41 62 |.str;...|if (doAb|
|00003210| 6f 75 74 20 26 26 20 69 | 74 65 6d 20 3d 3d 20 31 |out && i|tem == 1|
|00003220| 29 0d 09 7b 0d 09 09 69 | 66 20 28 61 70 70 6c 65 |)..{...i|f (apple|
|00003230| 41 62 6f 75 74 50 72 6f | 63 20 21 3d 20 6e 69 6c |AboutPro|c != nil|
|00003240| 29 0d 09 09 09 28 2a 61 | 70 70 6c 65 41 62 6f 75 |)....(*a|ppleAbou|
|00003250| 74 50 72 6f 63 29 20 28 | 29 3b 0d 09 7d 0d 09 65 |tProc) (|);..}..e|
|00003260| 6c 73 65 20 69 66 20 28 | 64 6f 48 65 6c 70 20 26 |lse if (|doHelp &|
|00003270| 26 20 69 74 65 6d 20 3d | 3d 20 32 29 20 7b 0d 09 |& item =|= 2) {..|
|00003280| 09 69 66 20 28 61 70 70 | 6c 65 48 65 6c 70 50 72 |.if (app|leHelpPr|
|00003290| 6f 63 20 21 3d 20 6e 69 | 6c 29 20 7b 0d 09 09 09 |oc != ni|l) {....|
|000032a0| 28 2a 61 70 70 6c 65 48 | 65 6c 70 50 72 6f 63 29 |(*appleH|elpProc)|
|000032b0| 20 28 29 3b 0d 09 09 7d | 0d 09 7d 0d 09 65 6c 73 | ();...}|..}..els|
|000032c0| 65 0d 09 7b 0d 09 09 47 | 65 74 50 6f 72 74 20 28 |e..{...G|etPort (|
|000032d0| 26 63 75 72 50 6f 72 74 | 29 3b 0d 09 09 47 65 74 |&curPort|);...Get|
|000032e0| 49 74 65 6d 20 28 61 70 | 70 6c 65 4d 65 6e 75 2c |Item (ap|pleMenu,|
|000032f0| 20 69 74 65 6d 2c 20 73 | 74 72 29 3b 09 09 2f 2a | item, s|tr);../*|
|00003300| 20 67 65 74 20 44 41 20 | 6e 61 6d 65 20 2a 2f 0d | get DA |name */.|
|00003310| 09 09 28 76 6f 69 64 29 | 20 4f 70 65 6e 44 65 73 |..(void)| OpenDes|
|00003320| 6b 41 63 63 20 28 73 74 | 72 29 3b 09 09 09 2f 2a |kAcc (st|r);.../*|
|00003330| 20 6f 70 65 6e 20 69 74 | 20 2a 2f 0d 09 09 53 65 | open it| */...Se|
|00003340| 74 50 6f 72 74 20 28 63 | 75 72 50 6f 72 74 29 3b |tPort (c|urPort);|
|00003350| 0d 09 7d 0d 7d 0d 0d 76 | 6f 69 64 20 44 6f 41 70 |..}.}..v|oid DoAp|
|00003360| 70 6c 65 43 6c 6f 62 62 | 65 72 20 28 76 6f 69 64 |pleClobb|er (void|
|00003370| 29 3b 0d 73 74 61 74 69 | 63 20 76 6f 69 64 20 44 |);.stati|c void D|
|00003380| 6f 41 70 70 6c 65 43 6c | 6f 62 62 65 72 20 28 29 |oAppleCl|obber ()|
|00003390| 0d 7b 0d 09 44 69 73 70 | 6f 73 65 4d 65 6e 75 20 |.{..Disp|oseMenu |
|000033a0| 28 61 70 70 6c 65 4d 65 | 6e 75 29 3b 0d 7d 0d 0d |(appleMe|nu);.}..|
|000033b0| 0d 2f 2a 20 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |./* ----|--------|
|000033c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000033d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000033e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000033f0| 2d 2d 2d 2d 2d 2d 2d 2d | 20 2a 2f 0d 2f 2a 09 09 |--------| */./*..|
|00003400| 09 09 09 09 57 69 6e 64 | 6f 77 2d 68 61 6e 64 6c |....Wind|ow-handl|
|00003410| 65 72 20 72 6f 75 74 69 | 6e 67 20 72 6f 75 74 69 |er routi|ng routi|
|00003420| 6e 65 73 09 09 09 09 09 | 2a 2f 0d 2f 2a 09 09 09 |nes.....|*/./*...|
|00003430| 09 09 09 09 09 09 09 09 | 09 09 09 09 09 09 09 2a |........|.......*|
|00003440| 2f 0d 2f 2a 09 45 61 63 | 68 20 72 6f 75 74 69 6e |/./*.Eac|h routin|
|00003450| 65 20 73 65 74 73 20 74 | 68 65 20 70 6f 72 74 20 |e sets t|he port |
|00003460| 74 6f 20 74 68 65 20 68 | 61 6e 64 6c 65 72 27 73 |to the h|andler's|
|00003470| 20 77 69 6e 64 6f 77 20 | 62 65 66 6f 72 65 20 65 | window |before e|
|00003480| 78 65 63 75 74 69 6e 67 | 09 2a 2f 0d 2f 2a 09 74 |xecuting|.*/./*.t|
|00003490| 68 65 20 68 61 6e 64 6c | 65 72 20 70 72 6f 63 65 |he handl|er proce|
|000034a0| 64 75 72 65 2e 09 09 09 | 09 09 09 09 09 09 09 09 |dure....|........|
|000034b0| 09 2a 2f 0d 2f 2a 20 2d | 2d 2d 2d 2d 2d 2d 2d 2d |.*/./* -|--------|
|000034c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000034d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000034e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000034f0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 20 2a 2f 0d 0d |--------|--- */..|
|00003500| 0d 2f 2a 0d 09 50 61 73 | 73 20 6c 6f 63 61 6c 20 |./*..Pas|s local |
|00003510| 6d 6f 75 73 65 20 63 6f | 6f 72 64 69 6e 61 74 65 |mouse co|ordinate|
|00003520| 73 2c 20 63 6c 69 63 6b | 20 74 69 6d 65 2c 20 61 |s, click| time, a|
|00003530| 6e 64 20 74 68 65 20 6d | 6f 64 69 66 69 65 72 73 |nd the m|odifiers|
|00003540| 20 66 6c 61 67 0d 09 77 | 6f 72 64 20 74 6f 20 74 | flag..w|ord to t|
|00003550| 68 65 20 68 61 6e 64 6c | 65 72 2e 0d 2a 2f 0d 0d |he handl|er..*/..|
|00003560| 76 6f 69 64 20 44 6f 4d | 6f 75 73 65 20 28 57 48 |void DoM|ouse (WH|
|00003570| 61 6e 64 6c 65 72 20 2a | 2a 2c 20 45 76 65 6e 74 |andler *|*, Event|
|00003580| 52 65 63 6f 72 64 20 2a | 29 3b 0d 73 74 61 74 69 |Record *|);.stati|
|00003590| 63 20 76 6f 69 64 20 44 | 6f 4d 6f 75 73 65 20 28 |c void D|oMouse (|
|000035a0| 68 2c 20 74 68 65 45 76 | 65 6e 74 29 0d 09 57 48 |h, theEv|ent)..WH|
|000035b0| 61 6e 64 6c 65 72 09 2a | 2a 68 3b 0d 09 45 76 65 |andler.*|*h;..Eve|
|000035c0| 6e 74 52 65 63 6f 72 64 | 09 2a 74 68 65 45 76 65 |ntRecord|.*theEve|
|000035d0| 6e 74 3b 0d 7b 0d 23 69 | 66 64 65 66 20 61 70 70 |nt;.{.#i|fdef app|
|000035e0| 6c 65 63 0d 09 72 65 67 | 69 73 74 65 72 20 76 6f |lec..reg|ister vo|
|000035f0| 69 64 09 28 2a 70 29 28 | 50 6f 69 6e 74 2c 20 6c |id.(*p)(|Point, l|
|00003600| 6f 6e 67 2c 20 73 68 6f | 72 74 29 3b 0d 23 65 6c |ong, sho|rt);.#el|
|00003610| 73 65 0d 09 72 65 67 69 | 73 74 65 72 20 76 6f 69 |se..regi|ster voi|
|00003620| 64 09 28 2a 70 29 28 29 | 3b 0d 23 65 6e 64 69 66 |d.(*p)()|;.#endif|
|00003630| 0d 09 50 6f 69 6e 74 09 | 09 09 74 68 65 50 74 3b |..Point.|..thePt;|
|00003640| 0d 0d 09 69 66 20 28 68 | 20 21 3d 20 6e 69 6c 29 |...if (h| != nil)|
|00003650| 20 7b 0d 09 09 53 65 74 | 50 6f 72 74 20 28 28 2a | {...Set|Port ((*|
|00003660| 2a 68 29 2e 77 68 57 69 | 6e 64 29 3b 0d 09 09 69 |*h).whWi|nd);...i|
|00003670| 66 20 28 28 70 20 3d 20 | 28 2a 2a 68 29 2e 77 68 |f ((p = |(**h).wh|
|00003680| 4d 6f 75 73 65 29 20 21 | 3d 20 6e 69 6c 29 20 7b |Mouse) !|= nil) {|
|00003690| 0d 09 09 09 74 68 65 50 | 74 20 3d 20 74 68 65 45 |....theP|t = theE|
|000036a0| 76 65 6e 74 2d 3e 77 68 | 65 72 65 3b 09 2f 2a 20 |vent->wh|ere;./* |
|000036b0| 6d 61 6b 65 20 6c 6f 63 | 61 6c 20 63 6f 70 79 20 |make loc|al copy |
|000036c0| 2a 2f 0d 09 09 09 47 6c | 6f 62 61 6c 54 6f 4c 6f |*/....Gl|obalToLo|
|000036d0| 63 61 6c 20 28 26 74 68 | 65 50 74 29 3b 0d 09 09 |cal (&th|ePt);...|
|000036e0| 09 28 2a 70 29 20 28 74 | 68 65 50 74 2c 20 74 68 |.(*p) (t|hePt, th|
|000036f0| 65 45 76 65 6e 74 2d 3e | 77 68 65 6e 2c 20 74 68 |eEvent->|when, th|
|00003700| 65 45 76 65 6e 74 2d 3e | 6d 6f 64 69 66 69 65 72 |eEvent->|modifier|
|00003710| 73 29 3b 0d 09 09 7d 0d | 09 7d 0d 7d 0d 0d 0d 2f |s);...}.|.}.}.../|
|00003720| 2a 0d 09 50 61 73 73 20 | 74 68 65 20 63 68 61 72 |*..Pass |the char|
|00003730| 61 63 74 65 72 20 61 6e | 64 20 74 68 65 20 6d 6f |acter an|d the mo|
|00003740| 64 69 66 69 65 72 73 20 | 66 6c 61 67 20 77 6f 72 |difiers |flag wor|
|00003750| 64 20 74 6f 20 74 68 65 | 20 68 61 6e 64 6c 65 72 |d to the| handler|
|00003760| 2e 0d 2a 2f 0d 0d 76 6f | 69 64 20 44 6f 4b 65 79 |..*/..vo|id DoKey|
|00003770| 20 28 57 48 61 6e 64 6c | 65 72 20 2a 2a 2c 20 63 | (WHandl|er **, c|
|00003780| 68 61 72 2c 20 75 6e 73 | 69 67 6e 65 64 20 63 68 |har, uns|igned ch|
|00003790| 61 72 2c 20 73 68 6f 72 | 74 29 3b 0d 73 74 61 74 |ar, shor|t);.stat|
|000037a0| 69 63 20 76 6f 69 64 20 | 44 6f 4b 65 79 20 28 68 |ic void |DoKey (h|
|000037b0| 2c 20 63 68 2c 20 63 6f | 64 65 2c 20 6d 6f 64 73 |, ch, co|de, mods|
|000037c0| 29 0d 09 57 48 61 6e 64 | 6c 65 72 09 09 2a 2a 68 |)..WHand|ler..**h|
|000037d0| 3b 0d 09 63 68 61 72 09 | 09 09 20 20 63 68 3b 0d |;..char.|.. ch;.|
|000037e0| 09 75 6e 73 69 67 6e 65 | 64 20 63 68 61 72 09 20 |.unsigne|d char. |
|000037f0| 20 63 6f 64 65 3b 0d 09 | 73 68 6f 72 74 09 09 09 | code;..|short...|
|00003800| 20 20 6d 6f 64 73 3b 0d | 7b 0d 23 69 66 64 65 66 | mods;.|{.#ifdef|
|00003810| 20 61 70 70 6c 65 63 0d | 09 72 65 67 69 73 74 65 | applec.|.registe|
|00003820| 72 20 76 6f 69 64 20 28 | 2a 70 29 28 63 68 61 72 |r void (|*p)(char|
|00003830| 2c 20 75 6e 73 69 67 6e | 65 64 20 63 68 61 72 2c |, unsign|ed char,|
|00003840| 20 73 68 6f 72 74 29 3b | 0d 23 65 6c 73 65 0d 09 | short);|.#else..|
|00003850| 72 65 67 69 73 74 65 72 | 20 76 6f 69 64 20 28 2a |register| void (*|
|00003860| 70 29 28 29 3b 0d 23 65 | 6e 64 69 66 0d 09 69 66 |p)();.#e|ndif..if|
|00003870| 20 28 68 20 21 3d 20 6e | 69 6c 29 20 7b 0d 09 09 | (h != n|il) {...|
|00003880| 53 65 74 50 6f 72 74 20 | 28 28 2a 2a 68 29 2e 77 |SetPort |((**h).w|
|00003890| 68 57 69 6e 64 29 3b 0d | 09 09 69 66 20 28 28 70 |hWind);.|..if ((p|
|000038a0| 20 3d 20 28 2a 2a 68 29 | 2e 77 68 4b 65 79 29 20 | = (**h)|.whKey) |
|000038b0| 21 3d 20 6e 69 6c 29 0d | 09 09 09 28 2a 70 29 20 |!= nil).|...(*p) |
|000038c0| 28 63 68 2c 20 63 6f 64 | 65 2c 20 6d 6f 64 73 29 |(ch, cod|e, mods)|
|000038d0| 3b 0d 09 7d 0d 7d 0d 0d | 0d 2f 2a 0d 09 43 61 6c |;..}.}..|./*..Cal|
|000038e0| 6c 20 74 68 65 20 77 69 | 6e 64 6f 77 20 75 70 64 |l the wi|ndow upd|
|000038f0| 61 74 69 6e 67 20 70 72 | 6f 63 65 64 75 72 65 2c |ating pr|ocedure,|
|00003900| 20 70 61 73 73 69 6e 67 | 20 74 6f 20 69 74 20 61 | passing| to it a|
|00003910| 6e 20 69 6e 64 69 63 61 | 74 6f 72 20 77 68 65 74 |n indica|tor whet|
|00003920| 68 65 72 0d 09 74 68 65 | 20 77 69 6e 64 6f 77 20 |her..the| window |
|00003930| 68 61 73 20 62 65 65 6e | 20 72 65 73 69 7a 65 64 |has been| resized|
|00003940| 20 6f 72 20 6e 6f 74 2e | 20 20 54 68 65 6e 20 63 | or not.| Then c|
|00003950| 6c 65 61 72 20 74 68 65 | 20 66 6c 61 67 2c 20 61 |lear the| flag, a|
|00003960| 73 73 75 6d 69 6e 67 0d | 09 74 68 65 20 75 70 64 |ssuming.|.the upd|
|00003970| 61 74 65 20 70 72 6f 63 | 20 74 6f 6f 6b 20 77 68 |ate proc| took wh|
|00003980| 61 74 65 76 65 72 20 61 | 63 74 69 6f 6e 20 77 61 |atever a|ction wa|
|00003990| 73 20 6e 65 63 65 73 73 | 61 72 79 20 74 6f 20 72 |s necess|ary to r|
|000039a0| 65 73 70 6f 6e 64 20 74 | 6f 0d 09 72 65 73 69 7a |espond t|o..resiz|
|000039b0| 69 6e 67 2e 0d 0d 09 49 | 66 20 74 68 65 20 68 61 |ing....I|f the ha|
|000039c0| 6e 64 6c 65 72 20 64 6f | 65 73 6e 27 74 20 68 61 |ndler do|esn't ha|
|000039d0| 76 65 20 61 6e 79 20 75 | 70 64 61 74 65 20 70 72 |ve any u|pdate pr|
|000039e0| 6f 63 2c 20 74 68 65 20 | 42 65 67 69 6e 2f 45 6e |oc, the |Begin/En|
|000039f0| 64 55 70 64 61 74 65 0d | 09 73 74 75 66 66 20 69 |dUpdate.|.stuff i|
|00003a00| 73 20 73 74 69 6c 6c 20 | 64 6f 6e 65 2c 20 74 6f |s still |done, to|
|00003a10| 20 63 6c 65 61 72 20 74 | 68 65 20 75 70 64 61 74 | clear t|he updat|
|00003a20| 65 20 72 65 67 69 6f 6e | 2e 20 20 4f 74 68 65 72 |e region|. Other|
|00003a30| 77 69 73 65 20 74 68 65 | 0d 09 57 69 6e 64 6f 77 |wise the|..Window|
|00003a40| 20 4d 61 6e 61 67 65 72 | 20 77 69 6c 6c 20 6b 65 | Manager| will ke|
|00003a50| 65 70 20 67 65 6e 65 72 | 61 74 69 6e 67 20 75 70 |ep gener|ating up|
|00003a60| 64 61 74 65 20 65 76 65 | 6e 74 73 20 66 6f 72 20 |date eve|nts for |
|00003a70| 74 68 65 20 77 69 6e 64 | 6f 77 2c 0d 09 73 74 61 |the wind|ow,..sta|
|00003a80| 6c 6c 69 6e 67 20 75 70 | 64 61 74 65 73 20 6f 66 |lling up|dates of|
|00003a90| 20 6f 74 68 65 72 20 77 | 69 6e 64 6f 77 73 2e 0d | other w|indows..|
|00003aa0| 0d 09 4d 61 6b 65 20 73 | 75 72 65 20 74 6f 20 73 |..Make s|ure to s|
|00003ab0| 61 76 65 20 61 6e 64 20 | 72 65 73 74 6f 72 65 20 |ave and |restore |
|00003ac0| 74 68 65 20 70 6f 72 74 | 2c 20 61 73 20 69 74 27 |the port|, as it'|
|00003ad0| 73 20 6e 6f 74 20 61 6c | 77 61 79 73 20 74 68 65 |s not al|ways the|
|00003ae0| 0d 09 61 63 74 69 76 65 | 20 77 69 6e 64 6f 77 20 |..active| window |
|00003af0| 74 68 61 74 20 69 73 20 | 75 70 64 61 74 65 64 2e |that is |updated.|
|00003b00| 0d 2a 2f 0d 0d 76 6f 69 | 64 20 44 6f 55 70 64 61 |.*/..voi|d DoUpda|
|00003b10| 74 65 20 28 57 48 61 6e | 64 6c 65 72 20 2a 2a 29 |te (WHan|dler **)|
|00003b20| 3b 0d 73 74 61 74 69 63 | 20 76 6f 69 64 20 44 6f |;.static| void Do|
|00003b30| 55 70 64 61 74 65 20 28 | 68 29 0d 09 57 48 61 6e |Update (|h)..WHan|
|00003b40| 64 6c 65 72 09 2a 2a 68 | 3b 0d 7b 0d 23 69 66 64 |dler.**h|;.{.#ifd|
|00003b50| 65 66 20 61 70 70 6c 65 | 63 0d 09 72 65 67 69 73 |ef apple|c..regis|
|00003b60| 74 65 72 20 76 6f 69 64 | 09 09 28 2a 70 29 28 42 |ter void|..(*p)(B|
|00003b70| 6f 6f 6c 65 61 6e 2c 20 | 73 68 6f 72 74 29 3b 0d |oolean, |short);.|
|00003b80| 23 65 6c 73 65 0d 09 72 | 65 67 69 73 74 65 72 20 |#else..r|egister |
|00003b90| 76 6f 69 64 09 09 28 2a | 70 29 28 29 3b 0d 23 65 |void..(*|p)();.#e|
|00003ba0| 6e 64 69 66 0d 09 72 65 | 67 69 73 74 65 72 20 47 |ndif..re|gister G|
|00003bb0| 72 61 66 50 74 72 09 75 | 70 64 50 6f 72 74 3b 0d |rafPtr.u|pdPort;.|
|00003bc0| 09 47 72 61 66 50 74 72 | 09 09 09 09 74 6d 70 50 |.GrafPtr|....tmpP|
|00003bd0| 6f 72 74 3b 0d 0d 09 69 | 66 20 28 68 20 21 3d 20 |ort;...i|f (h != |
|00003be0| 6e 69 6c 29 20 7b 0d 09 | 09 47 65 74 50 6f 72 74 |nil) {..|.GetPort|
|00003bf0| 20 28 26 74 6d 70 50 6f | 72 74 29 3b 0d 09 09 53 | (&tmpPo|rt);...S|
|00003c00| 65 74 50 6f 72 74 20 28 | 75 70 64 50 6f 72 74 20 |etPort (|updPort |
|00003c10| 3d 20 28 2a 2a 68 29 2e | 77 68 57 69 6e 64 29 3b |= (**h).|whWind);|
|00003c20| 0d 09 09 42 65 67 69 6e | 55 70 64 61 74 65 20 28 |...Begin|Update (|
|00003c30| 75 70 64 50 6f 72 74 29 | 3b 0d 09 09 69 66 20 28 |updPort)|;...if (|
|00003c40| 28 70 20 3d 20 28 2a 2a | 68 29 2e 77 68 55 70 64 |(p = (**|h).whUpd|
|00003c50| 61 74 65 29 20 21 3d 20 | 6e 69 6c 29 20 7b 0d 09 |ate) != |nil) {..|
|00003c60| 09 09 28 2a 70 29 20 28 | 28 2a 2a 68 29 2e 77 68 |..(*p) (|(**h).wh|
|00003c70| 53 69 7a 65 64 2c 20 28 | 2a 2a 68 29 2e 77 68 53 |Sized, (|**h).whS|
|00003c80| 69 7a 65 64 4d 6f 64 73 | 29 3b 0d 09 09 09 28 2a |izedMods|);....(*|
|00003c90| 2a 68 29 2e 77 68 53 69 | 7a 65 64 20 3d 20 66 61 |*h).whSi|zed = fa|
|00003ca0| 6c 73 65 3b 0d 09 09 09 | 28 2a 2a 68 29 2e 77 68 |lse;....|(**h).wh|
|00003cb0| 53 69 7a 65 64 4d 6f 64 | 73 20 3d 20 30 3b 0d 09 |SizedMod|s = 0;..|
|00003cc0| 09 7d 0d 09 09 45 6e 64 | 55 70 64 61 74 65 20 28 |.}...End|Update (|
|00003cd0| 75 70 64 50 6f 72 74 29 | 3b 0d 09 09 53 65 74 50 |updPort)|;...SetP|
|00003ce0| 6f 72 74 20 28 74 6d 70 | 50 6f 72 74 29 3b 0d 09 |ort (tmp|Port);..|
|00003cf0| 7d 0d 7d 0d 0d 0d 2f 2a | 0d 09 50 61 73 73 20 61 |}.}.../*|..Pass a|
|00003d00| 63 74 69 76 61 74 65 2f | 64 65 61 63 74 69 76 61 |ctivate/|deactiva|
|00003d10| 74 65 20 6e 6f 74 69 66 | 69 63 61 74 69 6f 6e 20 |te notif|ication |
|00003d20| 74 6f 20 68 61 6e 64 6c | 65 72 2e 0d 2a 2f 0d 0d |to handl|er..*/..|
|00003d30| 73 74 61 74 69 63 20 76 | 6f 69 64 20 44 6f 41 63 |static v|oid DoAc|
|00003d40| 74 69 76 61 74 65 20 28 | 74 68 65 57 69 6e 2c 20 |tivate (|theWin, |
|00003d50| 61 63 74 69 76 65 29 0d | 09 57 69 6e 64 6f 77 50 |active).|.WindowP|
|00003d60| 74 72 09 74 68 65 57 69 | 6e 3b 0d 09 42 6f 6f 6c |tr.theWi|n;..Bool|
|00003d70| 65 61 6e 09 09 61 63 74 | 69 76 65 3b 0d 7b 0d 23 |ean..act|ive;.{.#|
|00003d80| 69 66 64 65 66 20 61 70 | 70 6c 65 63 0d 09 72 65 |ifdef ap|plec..re|
|00003d90| 67 69 73 74 65 72 20 76 | 6f 69 64 20 28 2a 70 29 |gister v|oid (*p)|
|00003da0| 28 42 6f 6f 6c 65 61 6e | 29 3b 0d 23 65 6c 73 65 |(Boolean|);.#else|
|00003db0| 0d 09 72 65 67 69 73 74 | 65 72 20 76 6f 69 64 20 |..regist|er void |
|00003dc0| 28 2a 70 29 28 29 3b 0d | 23 65 6e 64 69 66 0d 09 |(*p)();.|#endif..|
|00003dd0| 57 48 61 6e 64 6c 65 72 | 09 2a 2a 68 3b 0d 0d 09 |WHandler|.**h;...|
|00003de0| 69 66 20 28 28 68 20 3d | 20 47 65 74 57 44 48 61 |if ((h =| GetWDHa|
|00003df0| 6e 64 6c 65 72 20 28 74 | 68 65 57 69 6e 29 29 20 |ndler (t|heWin)) |
|00003e00| 21 3d 20 6e 69 6c 29 20 | 7b 0d 09 09 53 65 74 50 |!= nil) |{...SetP|
|00003e10| 6f 72 74 20 28 28 2a 2a | 68 29 2e 77 68 57 69 6e |ort ((**|h).whWin|
|00003e20| 64 29 3b 0d 09 09 69 66 | 20 28 28 70 20 3d 20 28 |d);...if| ((p = (|
|00003e30| 2a 2a 68 29 2e 77 68 41 | 63 74 69 76 61 74 65 29 |**h).whA|ctivate)|
|00003e40| 20 21 3d 20 6e 69 6c 29 | 20 7b 0d 09 09 09 28 2a | != nil)| {....(*|
|00003e50| 70 29 20 28 61 63 74 69 | 76 65 29 3b 0d 09 09 7d |p) (acti|ve);...}|
|00003e60| 0d 09 09 2f 2a 20 72 65 | 73 65 74 20 74 68 65 20 |.../* re|set the |
|00003e70| 63 75 72 73 6f 72 20 72 | 65 67 69 6f 6e 20 2a 2f |cursor r|egion */|
|00003e80| 0d 09 09 69 66 20 28 61 | 63 74 69 76 65 29 20 7b |...if (a|ctive) {|
|00003e90| 0d 09 09 09 53 65 74 45 | 6d 70 74 79 52 67 6e 20 |....SetE|mptyRgn |
|00003ea0| 28 63 75 72 73 6f 72 52 | 67 6e 29 3b 0d 09 09 7d |(cursorR|gn);...}|
|00003eb0| 0d 09 7d 0d 7d 0d 0d 0d | 2f 2a 0d 09 45 78 65 63 |..}.}...|/*..Exec|
|00003ec0| 75 74 65 20 61 20 77 69 | 6e 64 6f 77 20 68 61 6e |ute a wi|ndow han|
|00003ed0| 64 6c 65 72 27 73 20 63 | 6c 6f 73 65 20 70 72 6f |dler's c|lose pro|
|00003ee0| 63 2e 20 20 54 68 69 73 | 20 6d 61 79 20 62 65 20 |c. This| may be |
|00003ef0| 75 73 65 64 20 62 79 20 | 68 61 6e 64 6c 65 72 73 |used by |handlers|
|00003f00| 0d 09 66 6f 72 20 74 65 | 6d 70 20 77 69 6e 64 6f |..for te|mp windo|
|00003f10| 77 73 20 74 68 61 74 20 | 77 61 6e 74 20 74 6f 20 |ws that |want to |
|00003f20| 72 65 6d 6f 76 65 20 74 | 68 65 6d 73 65 6c 76 65 |remove t|hemselve|
|00003f30| 73 20 77 68 65 6e 20 74 | 68 65 20 77 69 6e 64 6f |s when t|he windo|
|00003f40| 77 0d 09 69 73 20 63 6c | 6f 73 65 64 3a 20 20 74 |w..is cl|osed: t|
|00003f50| 68 65 79 20 63 61 6e 20 | 63 61 6c 6c 20 53 6b 65 |hey can |call Ske|
|00003f60| 6c 52 6d 76 65 57 69 6e | 64 20 74 6f 20 64 69 73 |lRmveWin|d to dis|
|00003f70| 70 6f 73 65 20 6f 66 20 | 74 68 65 20 77 69 6e 64 |pose of |the wind|
|00003f80| 6f 77 0d 09 61 6e 64 20 | 72 65 6d 6f 76 65 20 74 |ow..and |remove t|
|00003f90| 68 65 20 68 61 6e 64 6c | 65 72 20 66 72 6f 6d 20 |he handl|er from |
|00003fa0| 74 68 65 20 77 69 6e 64 | 6f 77 20 68 61 6e 64 6c |the wind|ow handl|
|00003fb0| 65 72 20 6c 69 73 74 2e | 20 20 54 68 75 73 2c 20 |er list.| Thus, |
|00003fc0| 77 69 6e 64 6f 77 73 0d | 09 6d 61 79 20 62 65 20 |windows.|.may be |
|00003fd0| 64 79 6e 61 6d 69 63 61 | 6c 6c 79 20 63 72 65 61 |dynamica|lly crea|
|00003fe0| 74 65 64 20 61 6e 64 20 | 64 65 73 74 72 6f 79 65 |ted and |destroye|
|00003ff0| 64 20 77 69 74 68 6f 75 | 74 20 66 69 6c 6c 69 6e |d withou|t fillin|
|00004000| 67 20 75 70 20 74 68 65 | 0d 09 68 61 6e 64 6c 65 |g up the|..handle|
|00004010| 72 20 6c 69 73 74 20 77 | 69 74 68 20 61 20 62 75 |r list w|ith a bu|
|00004020| 6e 63 68 20 6f 66 20 69 | 6e 76 61 6c 69 64 20 68 |nch of i|nvalid h|
|00004030| 61 6e 64 6c 65 72 73 2e | 0d 09 0d 09 49 66 20 74 |andlers.|....If t|
|00004040| 68 65 20 68 61 6e 64 6c | 65 72 20 64 6f 65 73 6e |he handl|er doesn|
|00004050| 27 74 20 68 61 76 65 20 | 61 20 63 6c 6f 73 65 20 |'t have |a close |
|00004060| 70 72 6f 63 2c 20 6a 75 | 73 74 20 68 69 64 65 20 |proc, ju|st hide |
|00004070| 74 68 65 20 77 69 6e 64 | 6f 77 2e 0d 09 54 68 65 |the wind|ow...The|
|00004080| 20 68 6f 73 74 20 73 68 | 6f 75 6c 64 20 70 72 6f | host sh|ould pro|
|00004090| 76 69 64 65 20 73 6f 6d | 65 20 77 61 79 20 6f 66 |vide som|e way of|
|000040a0| 20 72 65 6f 70 65 6e 69 | 6e 67 20 74 68 65 20 77 | reopeni|ng the w|
|000040b0| 69 6e 64 6f 77 20 28 70 | 65 72 68 61 70 73 0d 09 |indow (p|erhaps..|
|000040c0| 61 20 6d 65 6e 75 20 73 | 65 6c 65 63 74 69 6f 6e |a menu s|election|
|000040d0| 29 2e 20 20 4f 74 68 65 | 72 77 69 73 65 20 74 68 |). Othe|rwise th|
|000040e0| 65 20 77 69 6e 64 6f 77 | 20 77 69 6c 6c 20 62 65 |e window| will be|
|000040f0| 20 6c 6f 73 74 20 66 72 | 6f 6d 20 75 73 65 72 0d | lost fr|om user.|
|00004100| 09 63 6f 6e 74 72 6f 6c | 20 69 66 20 69 74 20 69 |.control| if it i|
|00004110| 73 20 68 69 64 64 65 6e | 2c 20 73 69 6e 63 65 20 |s hidden|, since |
|00004120| 69 74 20 77 6f 6e 27 74 | 20 72 65 63 65 69 76 65 |it won't| receive|
|00004130| 20 75 73 65 72 20 65 76 | 65 6e 74 73 2e 0d 0d 09 | user ev|ents....|
|00004140| 54 68 65 20 70 6f 72 74 | 20 69 73 20 73 65 74 20 |The port| is set |
|00004150| 74 6f 20 74 68 65 20 77 | 69 6e 64 6f 77 20 6d 61 |to the w|indow ma|
|00004160| 6e 61 67 65 72 20 70 6f | 72 74 20 61 66 74 65 72 |nager po|rt after|
|00004170| 20 63 61 6c 6c 69 6e 67 | 20 74 68 65 0d 09 68 61 | calling| the..ha|
|00004180| 6e 64 6c 65 72 20 70 72 | 6f 63 2c 20 74 6f 20 61 |ndler pr|oc, to a|
|00004190| 76 6f 69 64 20 61 20 64 | 61 6e 67 6c 69 6e 67 20 |void a d|angling |
|000041a0| 70 6f 72 74 2e 0d 0d 09 | 54 68 69 73 20 69 73 20 |port....|This is |
|000041b0| 63 61 6c 6c 65 64 20 62 | 6f 74 68 20 66 6f 72 20 |called b|oth for |
|000041c0| 72 65 67 75 6c 61 72 20 | 61 6e 64 20 64 69 61 6c |regular |and dial|
|000041d0| 6f 67 20 77 69 6e 64 6f | 77 73 2e 0d 2a 2f 0d 0d |og windo|ws..*/..|
|000041e0| 76 6f 69 64 20 44 6f 43 | 6c 6f 73 65 20 28 57 48 |void DoC|lose (WH|
|000041f0| 61 6e 64 6c 65 72 20 2a | 2a 29 3b 0d 73 74 61 74 |andler *|*);.stat|
|00004200| 69 63 20 76 6f 69 64 20 | 44 6f 43 6c 6f 73 65 20 |ic void |DoClose |
|00004210| 28 68 29 0d 09 57 48 61 | 6e 64 6c 65 72 09 2a 2a |(h)..WHa|ndler.**|
|00004220| 68 3b 0d 7b 0d 23 69 66 | 64 65 66 20 61 70 70 6c |h;.{.#if|def appl|
|00004230| 65 63 0d 09 72 65 67 69 | 73 74 65 72 20 76 6f 69 |ec..regi|ster voi|
|00004240| 64 09 09 28 2a 70 29 28 | 76 6f 69 64 29 3b 0d 23 |d..(*p)(|void);.#|
|00004250| 65 6c 73 65 0d 09 72 65 | 67 69 73 74 65 72 20 76 |else..re|gister v|
|00004260| 6f 69 64 09 09 28 2a 70 | 29 28 29 3b 0d 23 65 6e |oid..(*p|)();.#en|
|00004270| 64 69 66 0d 09 47 72 61 | 66 50 74 72 20 73 61 76 |dif..Gra|fPtr sav|
|00004280| 65 50 6f 72 74 3b 0d 0d | 09 69 66 20 28 68 20 21 |ePort;..|.if (h !|
|00004290| 3d 20 6e 69 6c 29 20 7b | 0d 09 09 69 66 20 28 28 |= nil) {|...if ((|
|000042a0| 70 20 3d 20 28 2a 2a 68 | 29 2e 77 68 43 6c 6f 73 |p = (**h|).whClos|
|000042b0| 65 29 20 21 3d 20 6e 69 | 6c 29 20 7b 0d 09 09 09 |e) != ni|l) {....|
|000042c0| 47 65 74 50 6f 72 74 20 | 28 26 73 61 76 65 50 6f |GetPort |(&savePo|
|000042d0| 72 74 29 3b 0d 09 09 09 | 53 65 74 50 6f 72 74 20 |rt);....|SetPort |
|000042e0| 28 28 2a 2a 68 29 2e 77 | 68 57 69 6e 64 29 3b 0d |((**h).w|hWind);.|
|000042f0| 09 09 09 28 2a 70 29 20 | 28 29 3b 0d 09 09 09 53 |...(*p) |();....S|
|00004300| 65 74 50 6f 72 74 20 28 | 73 61 76 65 50 6f 72 74 |etPort (|savePort|
|00004310| 29 3b 0d 09 09 7d 0d 09 | 09 65 6c 73 65 20 7b 0d |);...}..|.else {.|
|00004320| 09 09 09 48 69 64 65 57 | 69 6e 64 6f 77 20 28 28 |...HideW|indow ((|
|00004330| 2a 2a 68 29 2e 77 68 57 | 69 6e 64 29 3b 0d 09 09 |**h).whW|ind);...|
|00004340| 7d 0d 09 7d 0d 7d 0d 0d | 0d 2f 2a 0d 09 45 78 65 |}..}.}..|./*..Exe|
|00004350| 63 75 74 65 20 61 20 77 | 69 6e 64 6f 77 20 68 61 |cute a w|indow ha|
|00004360| 6e 64 6c 65 72 27 73 20 | 63 6c 6f 62 62 65 72 20 |ndler's |clobber |
|00004370| 70 72 6f 63 2e 0d 0d 09 | 54 68 65 20 70 6f 72 74 |proc....|The port|
|00004380| 20 69 73 20 73 65 74 20 | 74 6f 20 74 68 65 20 77 | is set |to the w|
|00004390| 69 6e 64 6f 77 20 6d 61 | 6e 61 67 65 72 20 70 6f |indow ma|nager po|
|000043a0| 72 74 20 61 66 74 65 72 | 20 63 61 6c 6c 69 6e 67 |rt after| calling|
|000043b0| 20 74 68 65 0d 09 68 61 | 6e 64 6c 65 72 20 70 72 | the..ha|ndler pr|
|000043c0| 6f 63 2c 20 74 6f 20 61 | 76 6f 69 64 20 61 20 64 |oc, to a|void a d|
|000043d0| 61 6e 67 6c 69 6e 67 20 | 70 6f 72 74 2e 0d 0d 09 |angling |port....|
|000043e0| 54 68 69 73 20 69 73 20 | 63 61 6c 6c 65 64 20 62 |This is |called b|
|000043f0| 6f 74 68 20 66 6f 72 20 | 72 65 67 75 6c 61 72 20 |oth for |regular |
|00004400| 61 6e 64 20 64 69 61 6c | 6f 67 20 77 69 6e 64 6f |and dial|og windo|
|00004410| 77 73 2e 0d 2a 2f 0d 0d | 76 6f 69 64 20 44 6f 43 |ws..*/..|void DoC|
|00004420| 6c 6f 62 62 65 72 20 28 | 57 48 61 6e 64 6c 65 72 |lobber (|WHandler|
|00004430| 20 2a 2a 29 3b 0d 73 74 | 61 74 69 63 20 76 6f 69 | **);.st|atic voi|
|00004440| 64 20 44 6f 43 6c 6f 62 | 62 65 72 20 28 68 29 0d |d DoClob|ber (h).|
|00004450| 09 57 48 61 6e 64 6c 65 | 72 09 2a 2a 68 3b 0d 7b |.WHandle|r.**h;.{|
|00004460| 0d 23 69 66 64 65 66 20 | 61 70 70 6c 65 63 0d 09 |.#ifdef |applec..|
|00004470| 72 65 67 69 73 74 65 72 | 20 76 6f 69 64 20 28 2a |register| void (*|
|00004480| 70 29 28 76 6f 69 64 29 | 3b 0d 23 65 6c 73 65 0d |p)(void)|;.#else.|
|00004490| 09 72 65 67 69 73 74 65 | 72 20 76 6f 69 64 20 28 |.registe|r void (|
|000044a0| 2a 70 29 28 29 3b 0d 23 | 65 6e 64 69 66 0d 09 47 |*p)();.#|endif..G|
|000044b0| 72 61 66 50 74 72 09 74 | 6d 70 50 6f 72 74 3b 0d |rafPtr.t|mpPort;.|
|000044c0| 0d 09 47 65 74 50 6f 72 | 74 20 28 26 74 6d 70 50 |..GetPor|t (&tmpP|
|000044d0| 6f 72 74 29 3b 0d 09 53 | 65 74 50 6f 72 74 20 28 |ort);..S|etPort (|
|000044e0| 28 2a 2a 68 29 2e 77 68 | 57 69 6e 64 29 3b 0d 09 |(**h).wh|Wind);..|
|000044f0| 69 66 20 28 28 70 20 3d | 20 28 2a 2a 68 29 2e 77 |if ((p =| (**h).w|
|00004500| 68 43 6c 6f 62 62 65 72 | 29 20 21 3d 20 6e 69 6c |hClobber|) != nil|
|00004510| 29 0d 09 09 28 2a 70 29 | 20 28 29 3b 0d 09 53 65 |)...(*p)| ();..Se|
|00004520| 74 50 6f 72 74 20 28 74 | 6d 70 50 6f 72 74 29 3b |tPort (t|mpPort);|
|00004530| 0d 7d 0d 0d 0d 2f 2a 0d | 09 45 78 65 63 75 74 65 |.}.../*.|.Execute|
|00004540| 20 68 61 6e 64 6c 65 72 | 27 73 20 69 64 6c 65 20 | handler|'s idle |
|00004550| 70 72 6f 63 2e 0d 0d 09 | 4d 61 6b 65 20 73 75 72 |proc....|Make sur|
|00004560| 65 20 74 6f 20 73 61 76 | 65 20 61 6e 64 20 72 65 |e to sav|e and re|
|00004570| 73 74 6f 72 65 20 74 68 | 65 20 70 6f 72 74 2c 20 |store th|e port, |
|00004580| 73 69 6e 63 65 20 69 64 | 6c 65 20 70 72 6f 63 73 |since id|le procs|
|00004590| 20 6d 61 79 20 62 65 0d | 09 63 61 6c 6c 65 64 20 | may be.|.called |
|000045a0| 66 6f 72 20 61 6e 79 20 | 77 69 6e 64 6f 77 2c 20 |for any |window, |
|000045b0| 6e 6f 74 20 6a 75 73 74 | 20 74 68 65 20 61 63 74 |not just| the act|
|000045c0| 69 76 65 20 6f 6e 65 2e | 0d 2a 2f 0d 0d 76 6f 69 |ive one.|.*/..voi|
|000045d0| 64 20 44 6f 49 64 6c 65 | 20 28 57 48 61 6e 64 6c |d DoIdle| (WHandl|
|000045e0| 65 72 20 2a 2a 29 3b 0d | 73 74 61 74 69 63 20 76 |er **);.|static v|
|000045f0| 6f 69 64 20 44 6f 49 64 | 6c 65 20 28 68 29 0d 09 |oid DoId|le (h)..|
|00004600| 57 48 61 6e 64 6c 65 72 | 09 2a 2a 68 3b 0d 7b 0d |WHandler|.**h;.{.|
|00004610| 23 69 66 64 65 66 20 61 | 70 70 6c 65 63 0d 09 72 |#ifdef a|pplec..r|
|00004620| 65 67 69 73 74 65 72 20 | 76 6f 69 64 20 28 2a 70 |egister |void (*p|
|00004630| 29 28 76 6f 69 64 29 3b | 0d 23 65 6c 73 65 0d 09 |)(void);|.#else..|
|00004640| 72 65 67 69 73 74 65 72 | 20 76 6f 69 64 20 28 2a |register| void (*|
|00004650| 70 29 28 29 3b 0d 23 65 | 6e 64 69 66 0d 09 47 72 |p)();.#e|ndif..Gr|
|00004660| 61 66 50 74 72 09 09 09 | 74 6d 70 50 6f 72 74 3b |afPtr...|tmpPort;|
|00004670| 0d 0d 09 69 66 20 28 68 | 20 21 3d 20 6e 69 6c 29 |...if (h| != nil)|
|00004680| 20 7b 0d 09 09 69 66 20 | 28 21 75 73 65 57 61 69 | {...if |(!useWai|
|00004690| 74 4e 65 78 74 45 76 65 | 6e 74 29 20 7b 0d 09 09 |tNextEve|nt) {...|
|000046a0| 09 53 79 73 74 65 6d 54 | 61 73 6b 20 28 29 3b 0d |.SystemT|ask ();.|
|000046b0| 09 09 7d 0d 09 09 47 65 | 74 50 6f 72 74 20 28 26 |..}...Ge|tPort (&|
|000046c0| 74 6d 70 50 6f 72 74 29 | 3b 0d 09 09 53 65 74 50 |tmpPort)|;...SetP|
|000046d0| 6f 72 74 20 28 28 2a 2a | 68 29 2e 77 68 57 69 6e |ort ((**|h).whWin|
|000046e0| 64 29 3b 0d 09 09 69 66 | 20 28 28 70 20 3d 20 28 |d);...if| ((p = (|
|000046f0| 2a 2a 68 29 2e 77 68 49 | 64 6c 65 29 20 21 3d 20 |**h).whI|dle) != |
|00004700| 6e 69 6c 29 0d 09 09 09 | 28 2a 70 29 20 28 29 3b |nil)....|(*p) ();|
|00004710| 0d 09 09 53 65 74 50 6f | 72 74 20 28 74 6d 70 50 |...SetPo|rt (tmpP|
|00004720| 6f 72 74 29 3b 0d 09 7d | 0d 7d 0d 0d 0d 23 69 66 |ort);..}|.}...#if|
|00004730| 64 65 66 09 73 75 70 70 | 6f 72 74 44 69 61 6c 6f |def.supp|ortDialo|
|00004740| 67 73 0d 0d 2f 2a 20 2d | 2d 2d 2d 2d 2d 2d 2d 2d |gs../* -|--------|
|00004750| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004760| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004770| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00004780| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 20 2a 2f 0d 2f |--------|--- */./|
|00004790| 2a 09 09 09 09 09 09 09 | 44 69 61 6c 6f 67 2d 68 |*.......|Dialog-h|
|000047a0| 61 6e 64 6c 69 6e 67 20 | 72 6f 75 74 69 6e 65 73 |andling |routines|
|000047b0| 09 09 09 09 09 2a 2f 0d | 2f 2a 20 2d 2d 2d 2d 2d |.....*/.|/* -----|
|000047c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000047d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000047e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000047f0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 20 |--------|------- |
|00004800| 2a 2f 0d 0d 0d 2f 2a 0d | 09 48 61 6e 64 6c 65 20 |*/.../*.|.Handle |
|00004810| 65 76 65 6e 74 20 69 66 | 20 69 74 27 73 20 66 6f |event if| it's fo|
|00004820| 72 20 61 20 64 69 61 6c | 6f 67 2e 20 20 54 68 65 |r a dial|og. The|
|00004830| 20 65 76 65 6e 74 20 6d | 75 73 74 20 62 65 20 6f | event m|ust be o|
|00004840| 6e 65 20 6f 66 0d 09 74 | 68 6f 73 65 20 74 68 61 |ne of..t|hose tha|
|00004850| 74 20 69 73 20 70 61 73 | 73 65 64 20 74 6f 20 64 |t is pas|sed to d|
|00004860| 69 61 6c 6f 67 73 20 61 | 63 63 6f 72 64 69 6e 67 |ialogs a|ccording|
|00004870| 20 74 6f 20 64 6c 6f 67 | 45 76 65 6e 74 4d 61 73 | to dlog|EventMas|
|00004880| 6b 2e 0d 09 54 68 69 73 | 20 6d 61 73 6b 20 63 61 |k...This| mask ca|
|00004890| 6e 20 62 65 20 73 65 74 | 20 73 6f 20 74 68 61 74 |n be set| so that|
|000048a0| 20 64 69 73 6b 2d 69 6e | 73 65 72 74 73 2c 20 66 | disk-in|serts, f|
|000048b0| 6f 72 20 69 6e 73 74 61 | 6e 63 65 2c 20 64 6f 6e |or insta|nce, don|
|000048c0| 27 74 0d 09 67 65 74 20 | 65 61 74 65 6e 20 75 70 |'t..get |eaten up|
|000048d0| 2e 0d 2a 2f 0d 0d 42 6f | 6f 6c 65 61 6e 20 44 6f |..*/..Bo|olean Do|
|000048e0| 44 69 61 6c 6f 67 20 28 | 45 76 65 6e 74 52 65 63 |Dialog (|EventRec|
|000048f0| 6f 72 64 20 2a 29 3b 0d | 73 74 61 74 69 63 20 42 |ord *);.|static B|
|00004900| 6f 6f 6c 65 61 6e 20 44 | 6f 44 69 61 6c 6f 67 20 |oolean D|oDialog |
|00004910| 28 65 76 74 29 0d 09 45 | 76 65 6e 74 52 65 63 6f |(evt)..E|ventReco|
|00004920| 72 64 20 2a 65 76 74 3b | 0d 7b 0d 09 72 65 67 69 |rd *evt;|.{..regi|
|00004930| 73 74 65 72 20 57 48 61 | 6e 64 6c 65 72 09 2a 2a |ster WHa|ndler.**|
|00004940| 64 68 3b 0d 09 44 69 61 | 6c 6f 67 50 74 72 09 09 |dh;..Dia|logPtr..|
|00004950| 09 74 68 65 44 69 61 6c | 6f 67 3b 0d 09 72 65 67 |.theDial|og;..reg|
|00004960| 69 73 74 65 72 20 73 68 | 6f 72 74 09 09 77 68 61 |ister sh|ort..wha|
|00004970| 74 3b 0d 09 73 68 6f 72 | 74 09 09 09 09 69 74 65 |t;..shor|t....ite|
|00004980| 6d 3b 0d 09 42 6f 6f 6c | 65 61 6e 09 09 09 09 68 |m;..Bool|ean....h|
|00004990| 61 6e 64 6c 65 64 49 74 | 20 3d 20 66 61 6c 73 65 |andledIt| = false|
|000049a0| 3b 0d 23 69 66 64 65 66 | 20 61 70 70 6c 65 63 0d |;.#ifdef| applec.|
|000049b0| 09 42 6f 6f 6c 65 61 6e | 09 09 09 09 28 2a 70 4b |.Boolean|....(*pK|
|000049c0| 65 79 73 29 28 73 68 6f | 72 74 20 2a 2c 20 45 76 |eys)(sho|rt *, Ev|
|000049d0| 65 6e 74 52 65 63 6f 72 | 64 20 2a 29 3b 0d 23 65 |entRecor|d *);.#e|
|000049e0| 6c 73 65 0d 09 42 6f 6f | 6c 65 61 6e 09 09 09 09 |lse..Boo|lean....|
|000049f0| 28 2a 70 4b 65 79 73 29 | 28 29 3b 0d 23 65 6e 64 |(*pKeys)|();.#end|
|00004a00| 69 66 0d 0d 09 74 68 65 | 44 69 61 6c 6f 67 20 3d |if...the|Dialog =|
|00004a10| 20 28 44 69 61 6c 6f 67 | 50 74 72 29 20 46 72 6f | (Dialog|Ptr) Fro|
|00004a20| 6e 74 57 69 6e 64 6f 77 | 20 28 29 3b 0d 09 69 66 |ntWindow| ();..if|
|00004a30| 20 28 28 64 68 20 3d 20 | 47 65 74 44 48 61 6e 64 | ((dh = |GetDHand|
|00004a40| 6c 65 72 20 28 74 68 65 | 44 69 61 6c 6f 67 29 29 |ler (the|Dialog))|
|00004a50| 20 21 3d 20 6e 69 6c 29 | 20 7b 0d 23 69 66 64 65 | != nil)| {.#ifde|
|00004a60| 66 20 61 70 70 6c 65 63 | 0d 09 09 70 4b 65 79 73 |f applec|...pKeys|
|00004a70| 20 3d 20 28 42 6f 6f 6c | 65 61 6e 20 28 2a 29 28 | = (Bool|ean (*)(|
|00004a80| 73 68 6f 72 74 20 2a 2c | 20 45 76 65 6e 74 52 65 |short *,| EventRe|
|00004a90| 63 6f 72 64 20 2a 29 29 | 20 28 2a 2a 64 68 29 2e |cord *))| (**dh).|
|00004aa0| 77 68 4b 65 79 3b 0d 23 | 65 6c 73 65 0d 09 09 70 |whKey;.#|else...p|
|00004ab0| 4b 65 79 73 20 3d 20 28 | 42 6f 6f 6c 65 61 6e 20 |Keys = (|Boolean |
|00004ac0| 28 2a 29 28 29 29 20 28 | 2a 2a 64 68 29 2e 77 68 |(*)()) (|**dh).wh|
|00004ad0| 4b 65 79 3b 0d 23 65 6e | 64 69 66 0d 09 7d 0d 09 |Key;.#en|dif..}..|
|00004ae0| 65 6c 73 65 20 7b 0d 09 | 09 70 4b 65 79 73 20 3d |else {..|.pKeys =|
|00004af0| 20 6e 69 6c 3b 0d 09 7d | 0d 09 77 68 61 74 20 3d | nil;..}|..what =|
|00004b00| 20 65 76 74 2d 3e 77 68 | 61 74 3b 0d 2f 2a 20 68 | evt->wh|at;./* h|
|00004b10| 61 6e 64 6c 65 20 63 6f | 6d 6d 61 6e 64 20 6b 65 |andle co|mmand ke|
|00004b20| 79 73 20 62 65 66 6f 72 | 65 20 74 68 65 79 20 67 |ys befor|e they g|
|00004b30| 65 74 20 74 6f 20 49 73 | 44 69 61 6c 6f 67 45 76 |et to Is|DialogEv|
|00004b40| 65 6e 74 20 2a 2f 0d 09 | 69 66 20 28 28 77 68 61 |ent */..|if ((wha|
|00004b50| 74 20 3d 3d 20 6b 65 79 | 44 6f 77 6e 20 7c 7c 20 |t == key|Down || |
|00004b60| 77 68 61 74 20 3d 3d 20 | 61 75 74 6f 4b 65 79 29 |what == |autoKey)|
|00004b70| 20 26 26 20 28 65 76 74 | 2d 3e 6d 6f 64 69 66 69 | && (evt|->modifi|
|00004b80| 65 72 73 20 26 20 63 6d | 64 4b 65 79 29 29 20 7b |ers & cm|dKey)) {|
|00004b90| 0d 09 09 69 66 20 28 21 | 28 70 4b 65 79 73 20 26 |...if (!|(pKeys &|
|00004ba0| 26 20 28 68 61 6e 64 6c | 65 64 49 74 20 3d 20 28 |& (handl|edIt = (|
|00004bb0| 2a 70 4b 65 79 73 29 20 | 28 26 69 74 65 6d 2c 20 |*pKeys) |(&item, |
|00004bc0| 65 76 74 29 29 29 29 20 | 7b 0d 09 09 09 69 66 20 |evt)))) |{....if |
|00004bd0| 28 21 28 64 68 20 26 26 | 20 28 2a 2a 64 68 29 2e |(!(dh &&| (**dh).|
|00004be0| 77 68 4d 6f 64 61 6c 29 | 29 20 7b 0d 09 09 09 09 |whModal)|) {.....|
|00004bf0| 44 6f 4d 65 6e 75 43 6f | 6d 6d 61 6e 64 20 28 4d |DoMenuCo|mmand (M|
|00004c00| 65 6e 75 4b 65 79 20 28 | 65 76 74 2d 3e 6d 65 73 |enuKey (|evt->mes|
|00004c10| 73 61 67 65 20 26 20 63 | 68 61 72 43 6f 64 65 4d |sage & c|harCodeM|
|00004c20| 61 73 6b 29 29 3b 0d 09 | 09 09 7d 0d 09 09 09 72 |ask));..|..}....r|
|00004c30| 65 74 75 72 6e 20 28 74 | 72 75 65 29 3b 0d 09 09 |eturn (t|rue);...|
|00004c40| 7d 0d 09 7d 0d 09 65 6c | 73 65 20 69 66 20 28 77 |}..}..el|se if (w|
|00004c50| 68 61 74 20 3d 3d 20 61 | 70 70 34 45 76 74 20 7c |hat == a|pp4Evt ||
|00004c60| 7c 20 77 68 61 74 20 3d | 3d 20 75 70 64 61 74 65 || what =|= update|
|00004c70| 45 76 74 29 20 7b 0d 09 | 09 2f 2a 20 64 6f 20 6d |Evt) {..|./* do m|
|00004c80| 75 6c 74 69 66 69 6e 64 | 65 72 20 65 76 65 6e 74 |ultifind|er event|
|00004c90| 73 2c 20 75 70 64 61 74 | 65 73 20 61 72 65 20 68 |s, updat|es are h|
|00004ca0| 61 6e 64 6c 65 64 20 69 | 6e 20 74 68 65 20 6d 61 |andled i|n the ma|
|00004cb0| 69 6e 20 6c 6f 6f 70 20 | 2a 2f 0d 09 09 69 66 20 |in loop |*/...if |
|00004cc0| 28 64 68 20 26 26 20 28 | 2a 2a 64 68 29 2e 77 68 |(dh && (|**dh).wh|
|00004cd0| 45 76 65 6e 74 29 20 7b | 0d 09 09 09 68 61 6e 64 |Event) {|....hand|
|00004ce0| 6c 65 64 49 74 20 3d 20 | 28 2a 28 2a 2a 64 68 29 |ledIt = |(*(**dh)|
|00004cf0| 2e 77 68 45 76 65 6e 74 | 29 28 26 69 74 65 6d 2c |.whEvent|)(&item,|
|00004d00| 20 65 76 74 29 3b 0d 09 | 09 7d 0d 09 09 72 65 74 | evt);..|.}...ret|
|00004d10| 75 72 6e 20 28 68 61 6e | 64 6c 65 64 49 74 29 3b |urn (han|dledIt);|
|00004d20| 09 09 20 20 20 09 2f 2a | 20 6d 61 69 6e 20 73 65 |.. ./*| main se|
|00004d30| 63 74 69 6f 6e 20 68 61 | 6e 64 6c 65 73 20 74 68 |ction ha|ndles th|
|00004d40| 65 73 65 20 2a 2f 0d 09 | 7d 0d 09 65 6c 73 65 20 |ese */..|}..else |
|00004d50| 69 66 20 28 28 28 31 20 | 3c 3c 20 77 68 61 74 29 |if (((1 |<< what)|
|00004d60| 20 26 20 64 6c 6f 67 45 | 76 65 6e 74 4d 61 73 6b | & dlogE|ventMask|
|00004d70| 29 20 26 26 20 49 73 44 | 69 61 6c 6f 67 45 76 65 |) && IsD|ialogEve|
|00004d80| 6e 74 20 28 65 76 74 29 | 29 20 7b 0d 09 09 69 74 |nt (evt)|) {...it|
|00004d90| 65 6d 20 3d 20 30 3b 0d | 09 09 73 77 69 74 63 68 |em = 0;.|..switch|
|00004da0| 20 28 77 68 61 74 29 20 | 7b 0d 09 09 09 63 61 73 | (what) |{....cas|
|00004db0| 65 20 6b 65 79 44 6f 77 | 6e 3a 0d 09 09 09 63 61 |e keyDow|n:....ca|
|00004dc0| 73 65 20 61 75 74 6f 4b | 65 79 3a 0d 09 09 09 09 |se autoK|ey:.....|
|00004dd0| 69 66 20 28 21 28 70 4b | 65 79 73 20 26 26 20 28 |if (!(pK|eys && (|
|00004de0| 68 61 6e 64 6c 65 64 49 | 74 20 3d 20 28 2a 70 4b |handledI|t = (*pK|
|00004df0| 65 79 73 29 20 28 26 69 | 74 65 6d 2c 20 65 76 74 |eys) (&i|tem, evt|
|00004e00| 29 29 29 29 20 7b 0d 09 | 09 09 09 09 68 61 6e 64 |)))) {..|....hand|
|00004e10| 6c 65 64 49 74 20 3d 20 | 44 69 61 6c 6f 67 53 65 |ledIt = |DialogSe|
|00004e20| 6c 65 63 74 20 28 65 76 | 74 2c 20 26 74 68 65 44 |lect (ev|t, &theD|
|00004e30| 69 61 6c 6f 67 2c 20 26 | 69 74 65 6d 29 3b 0d 09 |ialog, &|item);..|
|00004e40| 09 09 09 7d 0d 09 09 09 | 09 62 72 65 61 6b 3b 0d |...}....|.break;.|
|00004e50| 09 09 09 63 61 73 65 20 | 61 63 74 69 76 61 74 65 |...case |activate|
|00004e60| 45 76 74 3a 09 09 09 09 | 09 09 2f 2a 20 69 66 20 |Evt:....|../* if |
|00004e70| 61 63 74 69 76 61 74 65 | 20 2a 2f 0d 09 09 09 09 |activate| */.....|
|00004e80| 74 68 65 44 69 61 6c 6f | 67 20 3d 20 28 44 69 61 |theDialo|g = (Dia|
|00004e90| 6c 6f 67 50 74 72 29 20 | 65 76 74 2d 3e 6d 65 73 |logPtr) |evt->mes|
|00004ea0| 73 61 67 65 3b 0d 09 09 | 09 09 64 68 20 3d 20 47 |sage;...|..dh = G|
|00004eb0| 65 74 44 48 61 6e 64 6c | 65 72 20 28 28 57 69 6e |etDHandl|er ((Win|
|00004ec0| 64 6f 77 50 74 72 29 20 | 74 68 65 44 69 61 6c 6f |dowPtr) |theDialo|
|00004ed0| 67 29 3b 0d 09 09 09 09 | 69 66 20 28 28 65 76 74 |g);.....|if ((evt|
|00004ee0| 2d 3e 6d 6f 64 69 66 69 | 65 72 73 20 26 20 61 63 |->modifi|ers & ac|
|00004ef0| 74 69 76 65 46 6c 61 67 | 29 09 2f 2a 20 61 6e 64 |tiveFlag|)./* and|
|00004f00| 20 63 6f 6d 69 6e 67 20 | 61 63 74 69 76 65 20 2a | coming |active *|
|00004f10| 2f 0d 09 09 09 09 09 26 | 26 20 28 28 57 69 6e 64 |/......&|& ((Wind|
|00004f20| 6f 77 50 65 65 6b 29 20 | 74 68 65 44 69 61 6c 6f |owPeek) |theDialo|
|00004f30| 67 29 2d 3e 77 69 6e 64 | 6f 77 4b 69 6e 64 20 3d |g)->wind|owKind =|
|00004f40| 3d 20 64 69 61 6c 6f 67 | 4b 69 6e 64 29 20 7b 0d |= dialog|Kind) {.|
|00004f50| 09 09 09 09 09 53 65 74 | 50 6f 72 74 20 28 28 47 |.....Set|Port ((G|
|00004f60| 72 61 66 50 74 72 29 20 | 74 68 65 44 69 61 6c 6f |rafPtr) |theDialo|
|00004f70| 67 29 3b 0d 09 09 09 09 | 7d 0d 09 09 09 2f 2a 20 |g);.....|}..../* |
|00004f80| 66 61 6c 6c 20 74 68 72 | 6f 75 67 68 20 2a 2f 0d |fall thr|ough */.|
|00004f90| 09 09 09 64 65 66 61 75 | 6c 74 3a 0d 09 09 09 09 |...defau|lt:.....|
|00004fa0| 69 66 20 28 21 28 64 68 | 20 26 26 20 28 2a 2a 64 |if (!(dh| && (**d|
|00004fb0| 68 29 2e 77 68 45 76 65 | 6e 74 20 26 26 0d 09 09 |h).whEve|nt &&...|
|00004fc0| 09 09 09 09 28 68 61 6e | 64 6c 65 64 49 74 20 3d |....(han|dledIt =|
|00004fd0| 20 28 2a 28 2a 2a 64 68 | 29 2e 77 68 45 76 65 6e | (*(**dh|).whEven|
|00004fe0| 74 29 28 26 69 74 65 6d | 2c 20 65 76 74 29 29 09 |t)(&item|, evt)).|
|00004ff0| 29 29 20 7b 0d 09 09 09 | 09 09 68 61 6e 64 6c 65 |)) {....|..handle|
|00005000| 64 49 74 20 3d 20 44 69 | 61 6c 6f 67 53 65 6c 65 |dIt = Di|alogSele|
|00005010| 63 74 20 28 65 76 74 2c | 20 26 74 68 65 44 69 61 |ct (evt,| &theDia|
|00005020| 6c 6f 67 2c 20 26 69 74 | 65 6d 29 3b 0d 09 09 09 |log, &it|em);....|
|00005030| 09 7d 0d 09 09 09 09 62 | 72 65 61 6b 3b 0d 09 09 |.}.....b|reak;...|
|00005040| 7d 0d 09 09 69 66 20 28 | 28 64 68 20 3d 20 47 65 |}...if (|(dh = Ge|
|00005050| 74 44 48 61 6e 64 6c 65 | 72 20 28 28 57 69 6e 64 |tDHandle|r ((Wind|
|00005060| 6f 77 50 74 72 29 20 74 | 68 65 44 69 61 6c 6f 67 |owPtr) t|heDialog|
|00005070| 29 29 20 21 3d 20 6e 69 | 6c 29 20 7b 0d 09 09 09 |)) != ni|l) {....|
|00005080| 28 2a 2a 64 68 29 2e 77 | 68 49 74 65 6d 48 69 74 |(**dh).w|hItemHit|
|00005090| 20 3d 20 69 74 65 6d 3b | 0d 09 09 09 2f 2a 20 69 | = item;|..../* i|
|000050a0| 66 20 74 68 69 73 20 69 | 73 20 61 20 6d 6f 64 61 |f this i|s a moda|
|000050b0| 6c 20 64 69 61 6c 6f 67 | 2c 20 77 68 43 68 65 63 |l dialog|, whChec|
|000050c0| 6b 20 77 69 6c 6c 20 62 | 65 20 63 61 6c 6c 65 64 |k will b|e called|
|000050d0| 20 65 6c 73 65 77 68 65 | 72 65 20 2a 2f 0d 09 09 | elsewhe|re */...|
|000050e0| 09 69 66 20 28 28 2a 2a | 64 68 29 2e 77 68 43 68 |.if ((**|dh).whCh|
|000050f0| 65 63 6b 20 26 26 20 21 | 28 2a 2a 64 68 29 2e 77 |eck && !|(**dh).w|
|00005100| 68 4d 6f 64 61 6c 29 20 | 7b 0d 09 09 09 09 28 2a |hModal) |{.....(*|
|00005110| 28 2a 2a 64 68 29 2e 77 | 68 43 68 65 63 6b 29 20 |(**dh).w|hCheck) |
|00005120| 28 69 74 65 6d 29 3b 0d | 09 09 09 7d 0d 09 09 7d |(item);.|...}...}|
|00005130| 0d 09 7d 0d 09 72 65 74 | 75 72 6e 20 28 68 61 6e |..}..ret|urn (han|
|00005140| 64 6c 65 64 49 74 29 3b | 0d 7d 0d 0d 23 65 6e 64 |dledIt);|.}..#end|
|00005150| 69 66 0d 0d 2f 2a 20 2d | 2d 2d 2d 2d 2d 2d 2d 2d |if../* -|--------|
|00005160| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005170| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005180| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005190| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 20 2a 2f 0d 2f |--------|--- */./|
|000051a0| 2a 09 09 09 09 09 09 09 | 45 76 65 6e 74 2d 68 61 |*.......|Event-ha|
|000051b0| 6e 64 6c 69 6e 67 20 72 | 6f 75 74 69 6e 65 73 09 |ndling r|outines.|
|000051c0| 09 09 09 09 09 2a 2f 0d | 2f 2a 20 2d 2d 2d 2d 2d |.....*/.|/* -----|
|000051d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000051e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000051f0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00005200| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 20 |--------|------- |
|00005210| 2a 2f 0d 0d 0d 76 6f 69 | 64 20 53 6b 65 6c 43 68 |*/...voi|d SkelCh|
|00005220| 65 63 6b 43 75 72 73 6f | 72 20 28 57 48 61 6e 64 |eckCurso|r (WHand|
|00005230| 6c 65 72 20 2a 2a 2c 20 | 50 6f 69 6e 74 2c 20 52 |ler **, |Point, R|
|00005240| 67 6e 48 61 6e 64 6c 65 | 29 3b 0d 20 20 73 74 61 |gnHandle|);. sta|
|00005250| 74 69 63 20 76 6f 69 64 | 0d 53 6b 65 6c 43 68 65 |tic void|.SkelChe|
|00005260| 63 6b 43 75 72 73 6f 72 | 20 28 77 68 2c 20 6d 6f |ckCursor| (wh, mo|
|00005270| 75 73 65 2c 20 72 65 67 | 69 6f 6e 29 0d 09 57 48 |use, reg|ion)..WH|
|00005280| 61 6e 64 6c 65 72 20 2a | 2a 77 68 3b 0d 09 50 6f |andler *|*wh;..Po|
|00005290| 69 6e 74 20 6d 6f 75 73 | 65 3b 0d 09 52 67 6e 48 |int mous|e;..RgnH|
|000052a0| 61 6e 64 6c 65 20 72 65 | 67 69 6f 6e 3b 0d 7b 0d |andle re|gion;.{.|
|000052b0| 09 50 6f 69 6e 74 20 70 | 74 3b 0d 09 52 67 6e 48 |.Point p|t;..RgnH|
|000052c0| 61 6e 64 6c 65 20 61 72 | 72 6f 77 52 67 6e 2c 20 |andle ar|rowRgn, |
|000052d0| 6c 6f 63 61 6c 52 67 6e | 3b 0d 0d 09 69 66 20 28 |localRgn|;...if (|
|000052e0| 77 68 20 26 26 20 28 2a | 2a 77 68 29 2e 77 68 48 |wh && (*|*wh).whH|
|000052f0| 61 76 65 43 75 72 73 6f | 72 29 20 7b 0d 09 09 61 |aveCurso|r) {...a|
|00005300| 72 72 6f 77 52 67 6e 20 | 3d 20 4e 65 77 52 67 6e |rrowRgn |= NewRgn|
|00005310| 20 28 29 3b 0d 09 09 6c | 6f 63 61 6c 52 67 6e 20 | ();...l|ocalRgn |
|00005320| 3d 20 4e 65 77 52 67 6e | 20 28 29 3b 0d 09 09 43 |= NewRgn| ();...C|
|00005330| 6f 70 79 52 67 6e 20 28 | 28 2a 2a 77 68 29 2e 77 |opyRgn (|(**wh).w|
|00005340| 68 43 75 72 73 6f 72 52 | 67 6e 2c 20 6c 6f 63 61 |hCursorR|gn, loca|
|00005350| 6c 52 67 6e 29 3b 0d 09 | 09 43 6f 70 79 52 67 6e |lRgn);..|.CopyRgn|
|00005360| 20 28 73 63 72 65 65 6e | 73 52 67 6e 2c 20 61 72 | (screen|sRgn, ar|
|00005370| 72 6f 77 52 67 6e 29 3b | 0d 09 09 53 65 74 50 74 |rowRgn);|...SetPt|
|00005380| 20 28 26 70 74 2c 20 30 | 2c 20 30 29 3b 0d 09 09 | (&pt, 0|, 0);...|
|00005390| 53 65 74 50 6f 72 74 20 | 28 28 2a 2a 77 68 29 2e |SetPort |((**wh).|
|000053a0| 77 68 57 69 6e 64 29 3b | 0d 09 09 4c 6f 63 61 6c |whWind);|...Local|
|000053b0| 54 6f 47 6c 6f 62 61 6c | 20 28 26 70 74 29 3b 0d |ToGlobal| (&pt);.|
|000053c0| 09 09 4f 66 66 73 65 74 | 52 67 6e 20 28 6c 6f 63 |..Offset|Rgn (loc|
|000053d0| 61 6c 52 67 6e 2c 20 70 | 74 2e 68 2c 20 70 74 2e |alRgn, p|t.h, pt.|
|000053e0| 76 29 3b 0d 09 09 44 69 | 66 66 52 67 6e 20 28 61 |v);...Di|ffRgn (a|
|000053f0| 72 72 6f 77 52 67 6e 2c | 20 6c 6f 63 61 6c 52 67 |rrowRgn,| localRg|
|00005400| 6e 2c 20 61 72 72 6f 77 | 52 67 6e 29 3b 0d 0d 09 |n, arrow|Rgn);...|
|00005410| 09 69 66 20 28 50 74 49 | 6e 52 67 6e 20 28 6d 6f |.if (PtI|nRgn (mo|
|00005420| 75 73 65 2c 20 6c 6f 63 | 61 6c 52 67 6e 29 29 20 |use, loc|alRgn)) |
|00005430| 7b 0d 09 09 09 53 65 74 | 43 75 72 73 6f 72 20 28 |{....Set|Cursor (|
|00005440| 2a 28 2a 2a 77 68 29 2e | 77 68 43 75 72 73 6f 72 |*(**wh).|whCursor|
|00005450| 29 3b 0d 09 09 09 43 6f | 70 79 52 67 6e 20 28 6c |);....Co|pyRgn (l|
|00005460| 6f 63 61 6c 52 67 6e 2c | 20 72 65 67 69 6f 6e 29 |ocalRgn,| region)|
|00005470| 3b 0d 09 09 7d 0d 09 09 | 65 6c 73 65 20 7b 0d 09 |;...}...|else {..|
|00005480| 09 09 49 6e 69 74 43 75 | 72 73 6f 72 20 28 29 3b |..InitCu|rsor ();|
|00005490| 0d 09 09 09 43 6f 70 79 | 52 67 6e 20 28 61 72 72 |....Copy|Rgn (arr|
|000054a0| 6f 77 52 67 6e 2c 20 72 | 65 67 69 6f 6e 29 3b 0d |owRgn, r|egion);.|
|000054b0| 09 09 7d 0d 09 09 44 69 | 73 70 6f 73 65 52 67 6e |..}...Di|sposeRgn|
|000054c0| 20 28 6c 6f 63 61 6c 52 | 67 6e 29 3b 0d 09 09 44 | (localR|gn);...D|
|000054d0| 69 73 70 6f 73 65 52 67 | 6e 20 28 61 72 72 6f 77 |isposeRg|n (arrow|
|000054e0| 52 67 6e 29 3b 0d 09 7d | 0d 09 65 6c 73 65 20 7b |Rgn);..}|..else {|
|000054f0| 0d 09 09 49 6e 69 74 43 | 75 72 73 6f 72 20 28 29 |...InitC|ursor ()|
|00005500| 3b 0d 09 09 43 6f 70 79 | 52 67 6e 20 28 73 63 72 |;...Copy|Rgn (scr|
|00005510| 65 65 6e 73 52 67 6e 2c | 20 72 65 67 69 6f 6e 29 |eensRgn,| region)|
|00005520| 3b 0d 09 7d 0d 7d 0d 0d | 2f 2a 0d 09 48 61 76 65 |;..}.}..|/*..Have|
|00005530| 20 65 69 74 68 65 72 20 | 7a 6f 6f 6d 65 64 20 61 | either |zoomed a|
|00005540| 20 77 69 6e 64 6f 77 20 | 6f 72 20 73 69 7a 65 64 | window |or sized|
|00005550| 20 69 74 20 6d 61 6e 75 | 61 6c 6c 79 2e 20 20 49 | it manu|ally. I|
|00005560| 6e 76 61 6c 69 64 61 74 | 65 0d 09 69 74 20 74 6f |nvalidat|e..it to|
|00005570| 20 66 6f 72 63 65 20 61 | 6e 20 75 70 64 61 74 65 | force a|n update|
|00005580| 20 61 6e 64 20 73 65 74 | 20 74 68 65 20 27 72 65 | and set| the 're|
|00005590| 73 69 7a 65 64 27 20 66 | 6c 61 67 20 69 6e 20 74 |sized' f|lag in t|
|000055a0| 68 65 20 77 69 6e 64 6f | 77 0d 09 68 61 6e 64 6c |he windo|w..handl|
|000055b0| 65 72 20 74 72 75 65 2e | 20 20 54 68 65 20 70 6f |er true.| The po|
|000055c0| 72 74 20 69 73 20 61 73 | 73 75 6d 65 64 20 74 6f |rt is as|sumed to|
|000055d0| 20 62 65 20 73 65 74 20 | 74 6f 20 74 68 65 20 70 | be set |to the p|
|000055e0| 6f 72 74 20 74 68 61 74 | 20 63 68 61 6e 67 65 64 |ort that| changed|
|000055f0| 0d 09 73 69 7a 65 2e 0d | 2a 2f 0d 0d 76 6f 69 64 |..size..|*/..void|
|00005600| 20 54 72 69 67 67 65 72 | 55 70 64 61 74 65 20 28 | Trigger|Update (|
|00005610| 57 48 61 6e 64 6c 65 72 | 20 2a 2a 2c 20 47 72 61 |WHandler| **, Gra|
|00005620| 66 50 74 72 2c 20 73 68 | 6f 72 74 29 3b 0d 73 74 |fPtr, sh|ort);.st|
|00005630| 61 74 69 63 20 76 6f 69 | 64 20 54 72 69 67 67 65 |atic voi|d Trigge|
|00005640| 72 55 70 64 61 74 65 20 | 28 68 2c 20 67 72 6f 77 |rUpdate |(h, grow|
|00005650| 6e 50 6f 72 74 2c 20 6d | 6f 64 73 29 0d 09 57 48 |nPort, m|ods)..WH|
|00005660| 61 6e 64 6c 65 72 09 2a | 2a 68 3b 0d 09 47 72 61 |andler.*|*h;..Gra|
|00005670| 66 50 74 72 09 09 67 72 | 6f 77 6e 50 6f 72 74 3b |fPtr..gr|ownPort;|
|00005680| 0d 09 73 68 6f 72 74 09 | 09 6d 6f 64 73 3b 0d 7b |..short.|.mods;.{|
|00005690| 0d 09 47 72 61 66 50 74 | 72 20 73 61 76 65 50 6f |..GrafPt|r savePo|
|000056a0| 72 74 3b 0d 0d 09 47 65 | 74 50 6f 72 74 20 28 26 |rt;...Ge|tPort (&|
|000056b0| 73 61 76 65 50 6f 72 74 | 29 3b 0d 09 53 65 74 50 |savePort|);..SetP|
|000056c0| 6f 72 74 20 28 67 72 6f | 77 6e 50 6f 72 74 29 3b |ort (gro|wnPort);|
|000056d0| 0d 09 49 6e 76 61 6c 52 | 65 63 74 20 28 26 67 72 |..InvalR|ect (&gr|
|000056e0| 6f 77 6e 50 6f 72 74 2d | 3e 70 6f 72 74 52 65 63 |ownPort-|>portRec|
|000056f0| 74 29 3b 0d 09 69 66 20 | 28 68 20 21 3d 20 6e 69 |t);..if |(h != ni|
|00005700| 6c 29 20 7b 0d 09 09 28 | 2a 2a 68 29 2e 77 68 53 |l) {...(|**h).whS|
|00005710| 69 7a 65 64 20 3d 20 74 | 72 75 65 3b 0d 09 09 28 |ized = t|rue;...(|
|00005720| 2a 2a 68 29 2e 77 68 53 | 69 7a 65 64 4d 6f 64 73 |**h).whS|izedMods|
|00005730| 20 3d 20 6d 6f 64 73 3b | 0d 09 09 69 66 20 28 28 | = mods;|...if ((|
|00005740| 2a 2a 68 29 2e 77 68 48 | 61 76 65 43 75 72 73 6f |**h).whH|aveCurso|
|00005750| 72 20 26 26 20 67 72 6f | 77 6e 50 6f 72 74 20 3d |r && gro|wnPort =|
|00005760| 3d 20 46 72 6f 6e 74 57 | 69 6e 64 6f 77 20 28 29 |= FrontW|indow ()|
|00005770| 29 20 7b 0d 09 09 09 53 | 65 74 45 6d 70 74 79 52 |) {....S|etEmptyR|
|00005780| 67 6e 20 28 63 75 72 73 | 6f 72 52 67 6e 29 3b 0d |gn (curs|orRgn);.|
|00005790| 09 09 7d 0d 09 7d 0d 09 | 53 65 74 50 6f 72 74 20 |..}..}..|SetPort |
|000057a0| 28 73 61 76 65 50 6f 72 | 74 29 3b 0d 7d 0d 0d 2f |(savePor|t);.}../|
|000057b0| 2a 0d 09 53 69 7a 65 20 | 61 20 77 69 6e 64 6f 77 |*..Size |a window|
|000057c0| 2e 20 20 49 66 20 74 68 | 65 20 77 69 6e 64 6f 77 |. If th|e window|
|000057d0| 20 68 61 73 20 61 20 68 | 61 6e 64 6c 65 72 2c 20 | has a h|andler, |
|000057e0| 75 73 65 20 74 68 65 20 | 67 72 6f 77 20 6c 69 6d |use the |grow lim|
|000057f0| 69 74 73 0d 09 69 6e 20 | 74 68 65 20 68 61 6e 64 |its..in |the hand|
|00005800| 6c 65 72 20 72 65 63 6f | 72 64 2c 20 6f 74 68 65 |ler reco|rd, othe|
|00005810| 72 77 69 73 65 20 75 73 | 65 20 74 68 65 20 64 65 |rwise us|e the de|
|00005820| 66 61 75 6c 74 73 2e 0d | 0d 09 54 68 65 20 70 6f |faults..|..The po|
|00005830| 72 74 52 65 63 74 20 69 | 73 20 69 6e 76 61 6c 69 |rtRect i|s invali|
|00005840| 64 61 74 65 64 20 74 6f | 20 66 6f 72 63 65 20 61 |dated to| force a|
|00005850| 6e 20 75 70 64 61 74 65 | 20 65 76 65 6e 74 2e 20 |n update| event. |
|00005860| 20 28 54 68 65 20 70 6f | 72 74 0d 09 6d 75 73 74 | (The po|rt..must|
|00005870| 20 62 65 20 73 65 74 20 | 66 69 72 73 74 2c 20 61 | be set |first, a|
|00005880| 73 20 69 74 20 63 6f 75 | 6c 64 20 62 65 20 70 6f |s it cou|ld be po|
|00005890| 69 6e 74 69 6e 67 20 61 | 6e 79 77 68 65 72 65 2e |inting a|nywhere.|
|000058a0| 29 20 20 54 68 65 20 68 | 61 6e 64 6c 65 72 27 73 |) The h|andler's|
|000058b0| 0d 09 75 70 64 61 74 65 | 20 70 72 6f 63 65 64 75 |..update| procedu|
|000058c0| 72 65 20 73 68 6f 75 6c | 64 20 63 68 65 63 6b 20 |re shoul|d check |
|000058d0| 74 68 65 20 70 61 72 61 | 6d 65 74 65 72 20 70 61 |the para|meter pa|
|000058e0| 73 73 65 64 20 74 6f 20 | 69 74 20 74 6f 20 63 68 |ssed to |it to ch|
|000058f0| 65 63 6b 0d 09 77 68 65 | 74 68 65 72 20 74 68 65 |eck..whe|ther the|
|00005900| 20 77 69 6e 64 6f 77 20 | 68 61 73 20 63 68 61 6e | window |has chan|
|00005910| 67 65 64 20 73 69 7a 65 | 2c 20 69 66 20 69 74 20 |ged size|, if it |
|00005920| 6e 65 65 64 73 20 74 6f | 20 61 64 6a 75 73 74 20 |needs to| adjust |
|00005930| 69 74 73 65 6c 66 20 74 | 6f 0d 09 74 68 65 20 6e |itself t|o..the n|
|00005940| 65 77 20 73 69 7a 65 2e | 20 20 54 48 49 53 20 49 |ew size.| THIS I|
|00005950| 53 20 41 20 43 4f 4e 56 | 45 4e 54 49 4f 4e 2e 20 |S A CONV|ENTION. |
|00005960| 20 55 70 64 61 74 65 20 | 70 72 6f 63 73 20 6d 75 | Update |procs mu|
|00005970| 73 74 20 6e 6f 74 69 63 | 65 20 67 72 6f 77 0d 09 |st notic|e grow..|
|00005980| 22 65 76 65 6e 74 73 22 | 2c 20 74 68 65 72 65 20 |"events"|, there |
|00005990| 69 73 20 6e 6f 20 70 72 | 6f 63 65 64 75 72 65 20 |is no pr|ocedure |
|000059a0| 73 70 65 63 69 66 69 63 | 61 6c 6c 79 20 66 6f 72 |specific|ally for|
|000059b0| 20 73 75 63 68 20 65 76 | 65 6e 74 73 2e 0d 09 0d | such ev|ents....|
|000059c0| 09 54 68 65 20 63 6c 69 | 70 70 69 6e 67 20 72 65 |.The cli|pping re|
|000059d0| 63 74 61 6e 67 6c 65 20 | 69 73 20 6e 6f 74 20 72 |ctangle |is not r|
|000059e0| 65 73 65 74 2e 20 20 49 | 66 20 74 68 65 20 68 6f |eset. I|f the ho|
|000059f0| 73 74 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 0d 09 |st appli|cation..|
|00005a00| 6b 65 65 70 73 20 74 68 | 65 20 63 6c 69 70 70 69 |keeps th|e clippi|
|00005a10| 6e 67 20 73 65 74 20 65 | 71 75 61 6c 20 74 6f 20 |ng set e|qual to |
|00005a20| 74 68 65 20 70 6f 72 74 | 52 65 63 74 20 6f 72 20 |the port|Rect or |
|00005a30| 73 6f 6d 65 74 68 69 6e | 67 20 73 69 6d 69 6c 61 |somethin|g simila|
|00005a40| 72 2c 0d 09 74 68 65 6e | 20 69 74 20 77 69 6c 6c |r,..then| it will|
|00005a50| 20 68 61 76 65 20 74 6f | 20 61 72 72 61 6e 67 65 | have to| arrange|
|00005a60| 20 74 6f 20 74 72 65 61 | 74 20 77 69 6e 64 6f 77 | to trea|t window|
|00005a70| 20 67 72 6f 77 69 6e 67 | 20 77 69 74 68 20 6d 6f | growing| with mo|
|00005a80| 72 65 0d 09 63 61 72 65 | 2e 0d 0d 09 53 69 6e 63 |re..care|....Sinc|
|00005a90| 65 20 74 68 65 20 67 72 | 6f 77 20 72 65 67 69 6f |e the gr|ow regio|
|00005aa0| 6e 20 6f 66 20 6f 6e 6c | 79 20 74 68 65 20 61 63 |n of onl|y the ac|
|00005ab0| 74 69 76 65 20 77 69 6e | 64 6f 77 20 6d 61 79 20 |tive win|dow may |
|00005ac0| 62 65 20 63 6c 69 63 6b | 65 64 2c 0d 09 69 74 20 |be click|ed,..it |
|00005ad0| 73 68 6f 75 6c 64 20 6e | 6f 74 20 62 65 20 6e 65 |should n|ot be ne|
|00005ae0| 63 65 73 73 61 72 79 20 | 74 6f 20 73 65 74 20 74 |cessary |to set t|
|00005af0| 68 65 20 70 6f 72 74 2e | 0d 2a 2f 0d 0d 76 6f 69 |he port.|.*/..voi|
|00005b00| 64 20 44 6f 47 72 6f 77 | 20 28 57 48 61 6e 64 6c |d DoGrow| (WHandl|
|00005b10| 65 72 20 2a 2a 2c 20 47 | 72 61 66 50 74 72 2c 20 |er **, G|rafPtr, |
|00005b20| 50 6f 69 6e 74 2c 20 73 | 68 6f 72 74 29 3b 0d 73 |Point, s|hort);.s|
|00005b30| 74 61 74 69 63 20 76 6f | 69 64 20 44 6f 47 72 6f |tatic vo|id DoGro|
|00005b40| 77 20 28 68 2c 20 74 68 | 65 50 6f 72 74 2c 20 73 |w (h, th|ePort, s|
|00005b50| 74 61 72 74 50 74 2c 20 | 6d 6f 64 73 29 0d 09 57 |tartPt, |mods)..W|
|00005b60| 48 61 6e 64 6c 65 72 09 | 2a 2a 68 3b 0d 09 47 72 |Handler.|**h;..Gr|
|00005b70| 61 66 50 74 72 09 09 74 | 68 65 50 6f 72 74 3b 0d |afPtr..t|hePort;.|
|00005b80| 09 50 6f 69 6e 74 09 09 | 73 74 61 72 74 50 74 3b |.Point..|startPt;|
|00005b90| 0d 09 73 68 6f 72 74 09 | 09 6d 6f 64 73 3b 0d 7b |..short.|.mods;.{|
|00005ba0| 0d 09 52 65 63 74 09 09 | 09 09 72 3b 0d 09 72 65 |..Rect..|..r;..re|
|00005bb0| 67 69 73 74 65 72 20 6c | 6f 6e 67 09 09 67 72 6f |gister l|ong..gro|
|00005bc0| 77 52 65 73 3b 0d 0d 09 | 72 20 3d 20 28 2a 2a 68 |wRes;...|r = (**h|
|00005bd0| 29 2e 77 68 47 72 6f 77 | 3b 0d 09 2f 2a 20 67 72 |).whGrow|;../* gr|
|00005be0| 6f 77 20 72 65 73 75 6c | 74 20 6e 6f 6e 2d 7a 65 |ow resul|t non-ze|
|00005bf0| 72 6f 20 69 66 20 73 69 | 7a 65 20 63 68 61 6e 67 |ro if si|ze chang|
|00005c00| 65 09 2a 2f 0d 09 69 66 | 20 28 67 72 6f 77 52 65 |e.*/..if| (growRe|
|00005c10| 73 20 3d 20 47 72 6f 77 | 57 69 6e 64 6f 77 20 28 |s = Grow|Window (|
|00005c20| 74 68 65 50 6f 72 74 2c | 20 73 74 61 72 74 50 74 |thePort,| startPt|
|00005c30| 2c 20 26 72 29 29 20 7b | 0d 09 09 53 69 7a 65 57 |, &r)) {|...SizeW|
|00005c40| 69 6e 64 6f 77 20 28 74 | 68 65 50 6f 72 74 2c 20 |indow (t|hePort, |
|00005c50| 4c 6f 57 6f 72 64 20 28 | 67 72 6f 77 52 65 73 29 |LoWord (|growRes)|
|00005c60| 2c 20 48 69 57 6f 72 64 | 20 28 67 72 6f 77 52 65 |, HiWord| (growRe|
|00005c70| 73 29 2c 20 66 61 6c 73 | 65 29 3b 0d 09 09 54 72 |s), fals|e);...Tr|
|00005c80| 69 67 67 65 72 55 70 64 | 61 74 65 20 28 68 2c 20 |iggerUpd|ate (h, |
|00005c90| 74 68 65 50 6f 72 74 2c | 20 6d 6f 64 73 29 3b 0d |thePort,| mods);.|
|00005ca0| 09 7d 0d 7d 0d 0d 0d 2f | 2a 0d 09 5a 6f 6f 6d 20 |.}.}.../|*..Zoom |
|00005cb0| 74 68 65 20 63 75 72 72 | 65 6e 74 20 77 69 6e 64 |the curr|ent wind|
|00005cc0| 6f 77 2e 20 20 56 65 72 | 79 20 73 69 6d 69 6c 61 |ow. Ver|y simila|
|00005cd0| 72 20 74 6f 20 44 6f 47 | 72 6f 77 0d 0d 09 53 69 |r to DoG|row...Si|
|00005ce0| 6e 63 65 20 74 68 65 20 | 7a 6f 6f 6d 62 6f 78 20 |nce the |zoombox |
|00005cf0| 6f 66 20 6f 6e 6c 79 20 | 74 68 65 20 61 63 74 69 |of only |the acti|
|00005d00| 76 65 20 77 69 6e 64 6f | 77 20 6d 61 79 20 62 65 |ve windo|w may be|
|00005d10| 20 63 6c 69 63 6b 65 64 | 2c 0d 09 69 74 20 73 68 | clicked|,..it sh|
|00005d20| 6f 75 6c 64 20 6e 6f 74 | 20 62 65 20 6e 65 63 65 |ould not| be nece|
|00005d30| 73 73 61 72 79 20 74 6f | 20 73 65 74 20 74 68 65 |ssary to| set the|
|00005d40| 20 70 6f 72 74 2e 0d 2a | 2f 0d 0d 76 6f 69 64 20 | port..*|/..void |
|00005d50| 44 6f 5a 6f 6f 6d 20 28 | 57 48 61 6e 64 6c 65 72 |DoZoom (|WHandler|
|00005d60| 20 2a 2a 2c 20 47 72 61 | 66 50 74 72 2c 20 73 68 | **, Gra|fPtr, sh|
|00005d70| 6f 72 74 2c 20 73 68 6f | 72 74 29 3b 0d 73 74 61 |ort, sho|rt);.sta|
|00005d80| 74 69 63 20 76 6f 69 64 | 20 44 6f 5a 6f 6f 6d 20 |tic void| DoZoom |
|00005d90| 28 68 2c 20 7a 6f 6f 6d | 50 6f 72 74 2c 20 70 61 |(h, zoom|Port, pa|
|00005da0| 72 74 43 6f 64 65 2c 20 | 6d 6f 64 73 29 0d 09 72 |rtCode, |mods)..r|
|00005db0| 65 67 69 73 74 65 72 20 | 57 48 61 6e 64 6c 65 72 |egister |WHandler|
|00005dc0| 09 2a 2a 68 3b 0d 09 47 | 72 61 66 50 74 72 09 09 |.**h;..G|rafPtr..|
|00005dd0| 09 09 7a 6f 6f 6d 50 6f | 72 74 3b 0d 09 73 68 6f |..zoomPo|rt;..sho|
|00005de0| 72 74 09 09 09 09 70 61 | 72 74 43 6f 64 65 3b 0d |rt....pa|rtCode;.|
|00005df0| 09 73 68 6f 72 74 09 09 | 09 09 6d 6f 64 73 3b 0d |.short..|..mods;.|
|00005e00| 7b 0d 09 69 66 20 28 70 | 5a 6f 6f 6d 50 72 6f 63 |{..if (p|ZoomProc|
|00005e10| 29 20 7b 0d 09 09 2f 2a | 20 66 6f 72 20 61 20 63 |) {.../*| for a c|
|00005e20| 75 73 74 6f 6d 20 7a 6f | 6f 6d 20 70 72 6f 63 2c |ustom zo|om proc,|
|00005e30| 20 61 6c 6c 6f 77 20 74 | 68 65 20 75 73 65 72 20 | allow t|he user |
|00005e40| 74 6f 20 6d 6f 64 69 66 | 79 20 74 68 65 20 62 65 |to modif|y the be|
|00005e50| 68 61 76 69 6f 75 72 20 | 2a 2f 0d 09 09 28 2a 70 |haviour |*/...(*p|
|00005e60| 5a 6f 6f 6d 50 72 6f 63 | 29 20 28 7a 6f 6f 6d 50 |ZoomProc|) (zoomP|
|00005e70| 6f 72 74 2c 20 70 61 72 | 74 43 6f 64 65 2c 20 6d |ort, par|tCode, m|
|00005e80| 6f 64 73 2c 20 66 61 6c | 73 65 29 3b 0d 09 7d 0d |ods, fal|se);..}.|
|00005e90| 09 65 6c 73 65 20 7b 0d | 09 09 5a 6f 6f 6d 57 69 |.else {.|..ZoomWi|
|00005ea0| 6e 64 6f 77 20 28 7a 6f | 6f 6d 50 6f 72 74 2c 20 |ndow (zo|omPort, |
|00005eb0| 70 61 72 74 43 6f 64 65 | 2c 20 66 61 6c 73 65 29 |partCode|, false)|
|00005ec0| 3b 0d 09 7d 0d 09 54 72 | 69 67 67 65 72 55 70 64 |;..}..Tr|iggerUpd|
|00005ed0| 61 74 65 20 28 68 2c 20 | 7a 6f 6f 6d 50 6f 72 74 |ate (h, |zoomPort|
|00005ee0| 2c 20 6d 6f 64 73 29 3b | 0d 7d 0d 0d 2f 2a 0d 09 |, mods);|.}../*..|
|00005ef0| 47 65 6e 65 72 61 6c 20 | 65 76 65 6e 74 20 68 61 |General |event ha|
|00005f00| 6e 64 6c 65 72 0d 2a 2f | 0d 0d 76 6f 69 64 20 44 |ndler.*/|..void D|
|00005f10| 6f 45 76 65 6e 74 20 28 | 45 76 65 6e 74 52 65 63 |oEvent (|EventRec|
|00005f20| 6f 72 64 20 2a 29 3b 0d | 73 74 61 74 69 63 20 76 |ord *);.|static v|
|00005f30| 6f 69 64 20 44 6f 45 76 | 65 6e 74 20 28 74 68 65 |oid DoEv|ent (the|
|00005f40| 45 76 74 29 0d 09 45 76 | 65 6e 74 52 65 63 6f 72 |Evt)..Ev|entRecor|
|00005f50| 64 09 2a 74 68 65 45 76 | 74 3b 0d 7b 0d 09 72 65 |d.*theEv|t;.{..re|
|00005f60| 67 69 73 74 65 72 20 45 | 76 65 6e 74 52 65 63 6f |gister E|ventReco|
|00005f70| 72 64 09 2a 74 68 65 45 | 76 65 6e 74 3b 0d 09 50 |rd.*theE|vent;..P|
|00005f80| 6f 69 6e 74 09 09 09 09 | 09 65 76 74 50 74 3b 0d |oint....|.evtPt;.|
|00005f90| 09 47 72 61 66 50 74 72 | 09 09 09 09 09 65 76 74 |.GrafPtr|.....evt|
|00005fa0| 50 6f 72 74 3b 0d 09 72 | 65 67 69 73 74 65 72 20 |Port;..r|egister |
|00005fb0| 73 68 6f 72 74 09 09 09 | 65 76 74 50 61 72 74 3b |short...|evtPart;|
|00005fc0| 0d 09 72 65 67 69 73 74 | 65 72 20 63 68 61 72 09 |..regist|er char.|
|00005fd0| 09 09 65 76 74 43 68 61 | 72 3b 0d 09 72 65 67 69 |..evtCha|r;..regi|
|00005fe0| 73 74 65 72 20 75 6e 73 | 69 67 6e 65 64 20 63 68 |ster uns|igned ch|
|00005ff0| 61 72 09 65 76 74 43 6f | 64 65 3b 0d 09 72 65 67 |ar.evtCo|de;..reg|
|00006000| 69 73 74 65 72 20 73 68 | 6f 72 74 09 09 09 65 76 |ister sh|ort...ev|
|00006010| 74 4d 6f 64 73 20 3d 20 | 30 3b 0d 09 72 65 67 69 |tMods = |0;..regi|
|00006020| 73 74 65 72 20 57 48 61 | 6e 64 6c 65 72 09 09 2a |ster WHa|ndler..*|
|00006030| 2a 68 2c 20 2a 2a 74 3b | 0d 09 52 65 63 74 09 09 |*h, **t;|..Rect..|
|00006040| 09 09 09 72 3b 0d 09 57 | 69 6e 64 6f 77 50 74 72 |...r;..W|indowPtr|
|00006050| 09 09 09 09 66 72 6f 6e | 74 57 69 6e 64 6f 77 20 |....fron|tWindow |
|00006060| 3d 20 46 72 6f 6e 74 57 | 69 6e 64 6f 77 20 28 29 |= FrontW|indow ()|
|00006070| 3b 0d 0d 09 74 68 65 45 | 76 65 6e 74 20 3d 20 74 |;...theE|vent = t|
|00006080| 68 65 45 76 74 3b 0d 0d | 23 69 66 64 65 66 09 73 |heEvt;..|#ifdef.s|
|00006090| 75 70 70 6f 72 74 44 69 | 61 6c 6f 67 73 0d 09 69 |upportDi|alogs..i|
|000060a0| 66 28 44 6f 44 69 61 6c | 6f 67 20 28 74 68 65 45 |f(DoDial|og (theE|
|000060b0| 76 65 6e 74 29 29 0d 09 | 09 72 65 74 75 72 6e 3b |vent))..|.return;|
|000060c0| 0d 23 65 6e 64 69 66 0d | 0d 09 65 76 74 50 74 20 |.#endif.|..evtPt |
|000060d0| 3d 20 74 68 65 45 76 65 | 6e 74 2d 3e 77 68 65 72 |= theEve|nt->wher|
|000060e0| 65 3b 0d 09 65 76 74 4d | 6f 64 73 20 3d 20 74 68 |e;..evtM|ods = th|
|000060f0| 65 45 76 65 6e 74 2d 3e | 6d 6f 64 69 66 69 65 72 |eEvent->|modifier|
|00006100| 73 3b 0d 0d 09 73 77 69 | 74 63 68 20 28 74 68 65 |s;...swi|tch (the|
|00006110| 45 76 65 6e 74 2d 3e 77 | 68 61 74 29 20 7b 0d 09 |Event->w|hat) {..|
|00006120| 09 63 61 73 65 20 61 70 | 70 34 45 76 74 3a 09 09 |.case ap|p4Evt:..|
|00006130| 2f 2a 20 6d 75 6c 74 69 | 66 69 6e 64 65 72 20 65 |/* multi|finder e|
|00006140| 76 65 6e 74 20 2a 2f 0d | 09 09 09 7b 0d 09 09 09 |vent */.|...{....|
|00006150| 09 73 68 6f 72 74 20 66 | 6c 61 67 20 3d 20 28 28 |.short f|lag = ((|
|00006160| 74 68 65 45 76 65 6e 74 | 2d 3e 6d 65 73 73 61 67 |theEvent|->messag|
|00006170| 65 20 3e 3e 20 32 34 29 | 20 26 20 30 78 66 66 29 |e >> 24)| & 0xff)|
|00006180| 3b 0d 09 09 09 09 69 66 | 20 28 66 6c 61 67 20 3d |;.....if| (flag =|
|00006190| 3d 20 30 78 30 31 29 20 | 7b 0d 09 09 09 09 09 66 |= 0x01) |{......f|
|000061a0| 67 41 70 70 20 3d 20 28 | 28 74 68 65 45 76 65 6e |gApp = (|(theEven|
|000061b0| 74 2d 3e 6d 65 73 73 61 | 67 65 20 26 20 30 78 30 |t->messa|ge & 0x0|
|000061c0| 31 29 20 21 3d 20 30 29 | 3b 0d 09 09 09 09 09 44 |1) != 0)|;......D|
|000061d0| 6f 41 63 74 69 76 61 74 | 65 20 28 66 72 6f 6e 74 |oActivat|e (front|
|000061e0| 57 69 6e 64 6f 77 2c 20 | 66 67 41 70 70 29 3b 0d |Window, |fgApp);.|
|000061f0| 09 09 09 09 09 2f 2a 20 | 64 6f 65 73 20 74 68 65 |...../* |does the|
|00006200| 20 61 70 70 20 77 61 6e | 74 20 74 6f 20 6b 6e 6f | app wan|t to kno|
|00006210| 77 20 61 62 6f 75 74 20 | 73 75 73 70 65 6e 64 2f |w about |suspend/|
|00006220| 72 65 73 75 6d 65 3f 20 | 2a 2f 0d 09 09 09 09 09 |resume? |*/......|
|00006230| 69 66 20 28 70 53 75 73 | 70 65 6e 64 52 65 73 75 |if (pSus|pendResu|
|00006240| 6d 65 29 20 7b 0d 09 09 | 09 09 09 09 28 2a 70 53 |me) {...|....(*pS|
|00006250| 75 73 70 65 6e 64 52 65 | 73 75 6d 65 29 28 66 67 |uspendRe|sume)(fg|
|00006260| 41 70 70 29 3b 0d 09 09 | 09 09 09 7d 0d 09 09 09 |App);...|...}....|
|00006270| 09 09 2f 2a 20 73 68 6f | 75 6c 64 20 77 65 20 63 |../* sho|uld we c|
|00006280| 6f 6e 76 65 72 74 20 74 | 68 65 20 73 63 72 61 70 |onvert t|he scrap|
|00006290| 3f 20 20 41 6c 77 61 79 | 73 20 63 6f 6e 76 65 72 |? Alway|s conver|
|000062a0| 74 20 69 66 20 73 75 73 | 70 65 6e 64 0d 09 09 09 |t if sus|pend....|
|000062b0| 09 09 20 20 20 62 75 74 | 20 6f 6e 6c 79 20 63 6f |.. but| only co|
|000062c0| 6e 76 65 72 74 20 6f 6e | 20 72 65 73 75 6d 65 20 |nvert on| resume |
|000062d0| 69 66 20 22 63 68 61 6e | 67 65 64 20 73 63 72 61 |if "chan|ged scra|
|000062e0| 70 22 20 66 6c 61 67 20 | 62 69 74 20 69 73 20 73 |p" flag |bit is s|
|000062f0| 65 74 20 2a 2f 0d 09 09 | 09 09 09 69 66 20 28 28 |et */...|...if ((|
|00006300| 21 66 67 41 70 70 20 7c | 7c 20 28 74 68 65 45 76 |!fgApp ||| (theEv|
|00006310| 65 6e 74 2d 3e 6d 65 73 | 73 61 67 65 20 26 20 30 |ent->mes|sage & 0|
|00006320| 78 30 32 29 29 20 26 26 | 20 70 53 63 72 61 70 43 |x02)) &&| pScrapC|
|00006330| 6f 6e 76 65 72 74 29 20 | 7b 0d 09 09 09 09 09 09 |onvert) |{.......|
|00006340| 28 2a 70 53 63 72 61 70 | 43 6f 6e 76 65 72 74 29 |(*pScrap|Convert)|
|00006350| 28 66 67 41 70 70 29 3b | 0d 09 09 09 09 09 7d 0d |(fgApp);|......}.|
|00006360| 09 09 09 09 7d 0d 09 09 | 09 09 65 6c 73 65 20 69 |....}...|..else i|
|00006370| 66 20 28 66 6c 61 67 20 | 3d 3d 20 30 78 66 61 20 |f (flag |== 0xfa |
|00006380| 26 26 20 66 67 41 70 70 | 29 20 7b 0d 09 09 09 09 |&& fgApp|) {.....|
|00006390| 09 53 6b 65 6c 43 68 65 | 63 6b 43 75 72 73 6f 72 |.SkelChe|ckCursor|
|000063a0| 20 28 47 65 74 57 44 48 | 61 6e 64 6c 65 72 20 28 | (GetWDH|andler (|
|000063b0| 66 72 6f 6e 74 57 69 6e | 64 6f 77 29 2c 20 65 76 |frontWin|dow), ev|
|000063c0| 74 50 74 2c 20 63 75 72 | 73 6f 72 52 67 6e 29 3b |tPt, cur|sorRgn);|
|000063d0| 0d 09 09 09 09 7d 0d 09 | 09 09 09 65 6c 73 65 20 |.....}..|...else |
|000063e0| 69 66 20 28 66 6c 61 67 | 20 3d 3d 20 30 78 66 64 |if (flag| == 0xfd|
|000063f0| 29 20 7b 0d 09 09 09 09 | 09 69 66 20 28 70 43 68 |) {.....|.if (pCh|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.